Monday, March 4, 2013

basic commands you must know in linux

A small list of Linux commands which every one must know in order to work on console :

1. cd - change directory.
2. cd .. - go one directory level back.
3. pwd - present working directory.
4. rm - remove / delete a file. "rm <file>"
5. rm -r - recursively remove a directory.
6. cp - copy a file " cp<source> <destination>"
7. mv - move similar to cut in windows. "mv <source> <destination>"
8. cat - display contents of a file. "cat <file>"
9. grep - search string in a file. Used with pipe(|). "cat <file> | grep <string> " or. "grep <string> <file>
10. find - find a file in a directory. "find ./ -name <file>"
11. top - to monitor activities running on your system.
12. ls - list contents of a directory.
13. ps - show processes running on present console.
14. rlogin - remote login to server. "rlogin <server-name>"
15. ssh - open a secure shell to other server. "ssh <server-name>"
16 scp - secure copy to other server. "scp <file-name> <server-name>"
17. tar - to create a tar file. compressing a folder.
18. vi/vim/gvim - open file in code editors like vi,vim,gvim.
19. gedit - open file in gedit. "gedit <file>"
20. gcc - compile C code "gcc <file.c>". produces a.out.
21 ./<executable> - run the executable or script file.
22. chmod - change access mode of a file or directory. "777" sets it to all read, all write and all run.