1. PS
The PS command is a powerful command, and its power comes from its utter versatility. The PS command means 'process status', and displays everything to do with processes; think of it as the task manager of geeks. There are many variations of PS that can be used, such as the common PS AUX, which will pull a Terminal list of all running processes, or PS AUX | GREP PID to pull up a specific process. Used in conjunction with the kill command allows users to end processes.2. RM -RF
This command is, quite possibly, the most powerful command, as it can destroy entire systems in the wrong hands. The rm -rf dir is used to remove (permanently delete) a directory, or multiple directories. For example, rm -rf dir / will delete the home directory. This powerful command is perfect for removing an unneeded directory, but should be used with caution, and only by individuals who understand what they are doing.3. PSTREE
The pstree command is another variation of the PS command, and is quite useful for those who do frequent work on different machines and servers. If you need to get a quick peek at the different programs that are running, and what processes stem from other processes, PSTREE is more useful and organized than a general PS AUX command.4. HISTORY
Let's say that a directory randomly disappears from a user's computer, and they insist that they weren't playing in the Terminal and running commands that they shouldn't be. If you want to check up on a specific instance of a command being run, you can issue the command history | grep -i command, replacing command with your search term. If you're just interested in seeing a general history, you can just typehistory and get a list of all the activity that's been going on inside the Terminal.5. APROPOS
If knowledge is power, then apropos is a very powerful command, as it knows every command you can use for a specific item, such as directories or files. If you're looking for a certain command to run on, say, directories, but you can't quite remember what it's called, then running apropos dir will yield a list of possible commands. The same goes for files, pictures, documents, and more.6. LS
If you were to ask any Linux admin what command they use on a daily basis, the LS command will likely be the one. This useful, yet simple, command allows users to view the contents of a directory and, in conjunction with a number of other commands, to refine just what info you get. A good example is the LS -LH command; using this command within a directory will display the size of files with easy to read formats versus the long series of numbers usually displayed. For example, 8000 will become 8MB.7. GREP
If you're an astute reader you'll have noticed that we've shown many command examples that include grep; the frequency of this is a sign of the command's usefulness. The GREP command is a filter of sorts. It is used to search for any instance of a pattern that the user specifies and to output it to a neat list. So, for example, to filter through running processes for specific apps, you can add | grep app to find it. Likewise, if you would like to find a certain phrase within a text file, you could run a command like grep [aA] file.txt, which would return results for both small and capital 'A's'.8. FIND
The FIND command is incredibly powerful, especially when used as root. This command can be used to find anything on the system, as simple as that sounds, and anything within specific directories that you specify. For example, if you're in need of tweaking a password file for whatever reason, instead of manually hunting down all the files, you can instead run sudo find / -name passwd. This command will be run as root (replace sudo with whatever your distro uses), and find any file named 'passwd'. There are many different commands that can be used in conjunction with find, such as: -print, -perm, -type, etc.9. CRON
Sadly, this nifty little command is not included in popular lists as often as it should be. This command is powerful in that it can do things on your behalf when you're not around. Let's say that you're planning a weekend trip without a computer, and you need to make sure that your files are backed up every day. Like a smart admin, you'd never let anyone else touch your computer, let alone the Terminal. The solution? Use CRON. To do so, you simply set a time, then the command to be executed.The pattern for setting time is as follows: minute | hour | day | month | week + command.
For 'minute', specify the minute you would like it to start like so: 15. If you would like a command to run every specific set of minute intervals, add an asterisk after the minute command; to run a command over several different minute periods, add a comma to separate them.
For example: 04, 07, 23, 45 * * * * /usr/bin/something -backup
The same applies for 'hour', 'day', 'month', and 'week'.
10. WGET
Some people scoff at this one. WGET is powerful? Why, yes, yes it is. You see, WGET can be used to download things at any time, even if you're not there. It can be scheduled to run at midnight while you're safely tucked away in your bed, or to download a necessary update while you're out on business. WGET is a command that is used to fetch something from online; think of it as a download tool. There's a massive amount of commands that can be used in conjunction with WGET, all that function to make your life easier. Here's an example:WGET -M http://www.website.com/ . This command is used to mirror (aka, download) a website.
Source: Tech Lab Review
No comments:
Post a Comment