29 Haziran 2012 Cuma

Linux Commands – Top 20 Most Used

1.Files and Directories Management

  • ls – Lists files and directories content, I usually use “ls -la” to have a long listing with all the details and hidden files
  • cd – move from the current directory to a different folder
  • pwd – lists your current location
  • mv – this command can either change the name of a file, or move it to a different location.
  • locate – find any file on the Linux server, to get an updated index of files (if for example you just installed a whole bunch of RPM’s) run the command updatedb
  • ln – create a shortcut to a file or folder
  • tar – create or extract files out of a storage file. with the correct arguments it will also compress the files


2. Editing and Viewing
  • tail – lists the last 10 lines of a file, but you tell tell it to show any number of last lines
  • vi – the best command line editing software :)   a little hard to learn how to work this one at first, buts its worth the effort
  • cat – list the content of the file. better know how long is the file you are running this command on, or you will get a very long scrolling of lines that will fill up your screen

3. General

  • history – lists the last used commands on your Linux server
  • make – when compiling a software from source, this command will create the binaries
  • id – who am I right now? besides the philosophical angle, this command will show you as which user you will be running commands, I use this to check what is my status, and then sudo to the user I need
  • sudo – execute a command as another user – although  usually use it to change to root
  • ps – list the running processes on the server, it give more info like the process id, the parent process id, running time and much more
  • man – displays a manual page, whenever you are not sure about a specific command or config file, you should run “man command” to get info about it. to search the man database use “whatis command” to find which man file has the info you need
  • df – report file system disk space usage, use “df -h” to get a human formatted listing

Hiç yorum yok:

Yorum Gönder