cc-by-sa Tomer Cohen
Blog post: http://tomercohen.com/?p=1400 (Hebrew)
Content used in this presentation from various sources, including Wikipedia and xkcd. Sources available in the commit messages. Feel free to fork this presentation and use it for your own needs. I'd be happy to hear if you find it useful.
Tomer Cohen, http://tomercohen.com/
Linux kernel + GNU software =
rw- r-- --- user group filename
In Linux, everything lives in a logical filesystem…
Most operating systems have Command Line Interface in addition to the Graphical UI.
Linux isn't different. In fact, almost everything in Linux can be done from the command line.
ls
– Show content of current directory (similar to DOS dir command)
cd
– Change directory (similar to DOS cd command)
pwd
– Show current directory (again, similar to DOS cd command)
mkdir
– Create directory (similar to DOS mkdir/md commands)
cat
– Print file content (Similar to DOS type command)
rmdir
– Remove directory (similar to DOS rmdir/rd commands)
rm
– Remove file(s) (similar to DOS del command)
chmod
– Change file permissions (similar to Windows cacl command)
chown
– Change file owner
chgrp
– Change file group
ps
– Show list of processes (similar to Windows tasklist command)
kill
– Terminate a running process
man
– Provide documentation for a given command (Very handy! ☺)
touch
– Create an empty file/Set file modification time to now
sort
– Sort a given text file
grep
– Find given patterns in text stream
sed
– Manipulate text streams
Linux contain three different streams:
ls > filename
– Redirect command output to file
cat foo >> filename
– Append command output to file
cat < filename
– Read input from file
ls &> filename
– Redirect both STDOUT and STDERR to a file
The pipe operator | use the output of one command as the input to the second command.
It allow us run few commands in a batch so each command will process the output of the previous command.
$ date # Show current time/date Wed Mar 20 23:18:55 IST 2013 $ date | grep -o ..:..:.. # Extract the time pattern 23:18:55 $ ls | grep [א-ת] > list.txt # Find files contains Hebrew letters and write these to a file
cat > filename
chmod +x filename
./filename
Tomer Cohen, http://tomercohen.com
Presentation slides available online: http://tomer.github.com/linux101