<-Pre | Home | Next-> |
man - show manual for a command,
eg: man ls
cd - change directory
eg: cd /test/
ls - list directory, similar to dir on windows.
eg: ls, ls -l, ls -a, ls -lr, ls -ltr etc.
cp - copy a file or directory, example: cp source dest if you want to copy a directory use the -R option for recursive: cp -R /source /dest
mv - move a file,
eg: mv source dest
rm - remove a file,remove directory entries
eg: rm somefile , To remove a directory you may need the -r option, you can also use the -f option which tells it not to confirm each file: rm -rf /dir
ln - make links
eg: ln -s Create a symbolic link (Also called soft link).
cat - cat - concatenate and print files
eg: cat /var/log/messages
mkdir - make directories
eg: mkdir test
locate - find filenames quickly
eg: locate test.txt
diff - find differences between two files
eg: diff test1.java test2.java
more - outputs one page of a file and pauses. example: more /var/log/messages press q to exit before getting to the bottom. You can also pipe to more | more from other commands.
eg: ls -l /etc | more
scp - secure copy, copies a file over SSH to another server.
eg: scp /local/file user@host.com:/path to save file
tar - tape archiver; manipulate "tar" archive files. tar takes a bunch of files, and munges them into one .tar file, the files are often compressed with the gzip algorithm, and use the .tar.gz or .tar extension.
To create a tar tar -cvf archive.tar /directory, then to extract the archive to the current directory run tar -xf archive.tar to use gzip, just add a z to the options, to create a tar.gz: tar -czf archive.tar.gz /dir to extract it tar -xzf archive.tar.gz
file - determine file type
eg: file test.txt output is - test.txt: ASCII text
grep - print lines matching a pattern. grep searches the named input FILEs (or standard input if no files are named, or the file name - is given) for lines
containing a match to the given PATTERN.By default, grep prints the matching lines.
eg: grep -nri / "search text"
chmod - chmod - change file modes
eg: chmod 755 test.txt
find - lists files and directories recursively on a single line, I usually pipe grep into the mix when I use find,
eg: find / | fgrep log
w - display who is logged in and what they are doing
eg: w
tail - prints the last few lines of a file, this is handy for checking log files tail /var/log/messages if you need see more lines, use the -n option, tail -n 50 /var/log/messages you can also use the -f option, which will continuously show you the end of the file as things are added to it (very handy for watching logs).
eg:tail -f /var/log/messages
head - same as tail, but shows the first few lines the file
ps - Shows processes status
eg: ps -auxwww
pwd - return working directory name
eg: pwd
ping - to test if the host is up and running.
eg: ping google.com
date - display or set date and time
eg: date
top - Shows the most active processes on the system
eg: top
gzip - compress files
eg: gzip
gunzip - expand files
eg: gunzip
passwd - Allows you to change your password.
eg: passwd
kill - terminate or signal a process
eg: kill 718 ( here 718 is PID )
du - display disk usage statistics
eg: du sh *
df - display free disk space
eg: df ftp - establishes an ftp link with machinename
eg: ftp 10.60.0.193 (10.60.0.193 Is the IP Address of the machine)
env - shows current environment set-up
eg: env
chown - chown - change file owner and group
Pre->Hibernate | Next->Windows Commands |
No comments:
Post a Comment