Saturday, December 3, 2011

All In One-Linux

Command Meaning
ls list files and directories
ls -a list all files and directories
mkdir make a directory
cd directory change to named directory
cd change to home-directory
cd ~ change to home-directory
cd .. change to parent directory
pwd display the path of the current directory
cp file1 file2 copy file1 and call it file2
mv file1 file2 move or rename file1 to file2
rm file remove a file
rmdir directory remove a directory
cat file display a file
less file display a file a page at a time
head file display the first few lines of a file
tail file display the last few lines of a file
grep 'keyword' file search a file for keywords
-v display those lines that do NOT match
-n precede each matching line with the line number
-c print only the total count of matched lines
wc file count number of lines/words/characters in file
-w To do a word count
-l To find out how many lines the file has
command > file redirect standard output to a file
command >> file append standard output to a file
**********command < file redirect standard input from a file command1 | command2 pipe the output of command1 to the input of command2 cat file1 file2 > file0 concatenate file1 and file2 to file0
*********sort sort data
who list users currently logged in
* match any number of characters
? match one character
man command read the online manual page for a command
whatis command brief description of a command
apropos keyword match commands with keyword in their man pages
ls -lag list access rights for all files
chmod [options] file change access rights for named file
u
user
g
group
o
other
a
all
r
read
w
write (and delete)
x
execute (and access directory)
+
add permission
-
take away permission
usefull links
http://www.ee.surrey.ac.uk/Teaching/Unix/unix5.html
TAR:
http://www.computerhope.com/unix/utar.html
CHMOD: http://www.computerhope.com/unix/uchmod.htm
LS: http://www.computerhope.com/unix/uls.htm
FIND: http://www.computerhope.com/unix/ufind.htm
GREP: http://www.computerhope.com/unix/ugrep.htm
CP: http://www.computerhope.com/unix/ucp.htm
VI: http://www.computerhope.com/unix/uvi.htm
IFCONFIG: http://www.computerhope.com/unix/uifconfi.htm
DATE: http://www.computerhope.com/unix/udate.htm
KILL: http://www.computerhope.com/unix/ukill.htm