Changes

Jump to: navigation, search

Command line

16 bytes added, 22:50, 14 February 2009
no edit summary
Okay. Imagine, you just want to know about the files and directories containing the sequence "run". In order to achieve this, you can pass the output of the "ls" command to another program. A very common filter program is "grep". You use "grep" by telling the program what to filter. Directing the output of "ls" to "grep" (filtering for "run") is by using the ''pipe'' symbol: "|"
username@computername:~/flightgear$ ls | grep run fgrun run_fgcom.sh run_fgfs.sh run_fgfs_test.sh run_fgfs_test.sh~ run_fgjs.sh run_fgjs.sh~ run_fgrun.sh run_fgrun.sh~ run_js_demo.sh run_js_demo.sh~ run_terrasync.sh
Easy, isn't it?
username@computername:~/flightgear$ ls -l | grep download_and_compile.sh
-rwxr-xr-x 1 username usergroupname 15263 2009-02-05 21:23 download_and_compile.sh
username@reggae-machine:~/flightgear$ chmod -x download_and_compile.sh
username@reggae-machine:~/flightgear$ ls -l | grep download_and_compile.sh
-rw-r--r-- 1 username usergroupname 15263 2009-02-05 21:23 download_and_compile.sh
username@reggae-machine:~/flightgear$ chmod +x download_and_compile.sh
username@reggae-machine:~/flightgear$ ls -l | grep download_and_compile.sh
-rwxr-xr-x 1 username usergroupname 15263 2009-02-05 21:23 download_and_compile.sh
Notice, that "download_and_compile.sh"
51
edits

Navigation menu