Screenshots: Five command-line apps every Linux newbie needs to know
Image 1 of 6
Linux has taken over the enterprise. It runs the backbonernfor many of the largest companies. It’s one of the biggest players in big data.rnIf you’re serious about moving up the IT ladder, at some point, you’re going tornhave to know Linux.
And although the Linux GUI tools are now as good as thosernavailable for any other platform, some tasks will require a bit of command-linernknowledge. But where do you begin? You start off where every Linux newbie should…rnwith what I believe are five of the most important commands for new Linux adminsrnto learn.
Note: This gallery is also available as an article.
Nearly every command on your system should have a man page,rnall of which are set up to follow a specific standard. You’ll get the commandrnstructure, information about all the flags, switches, and options, commandrnsyntax, a history of the command, and related commands. If you’ve ever hearrnsomeone say RTFM…consider that u201cmu201d to be u201cman page.u201d
If you want to do a recursive listing (so you can also seernwhat’s tucked away within those folders), issue the command ls -R.rnIf you want to find out more about what ls can do for you, guessrnwhat…RTFM!
Use this tool with caution. For instance, suppose you haverntwo files: test and test1. You want to rename testrnand you accidentally issue the command mv test test1. This command willrnoverwrite your existing test1 file with the contents of test.rnTo avoid that you can use the -nrnoption, which will prevent mv from overwriting an existingrnfile. So mv -n test test1 will not overwrite test1 with test.rnThis is a precaution everyone should take.
If you need to delete a folder, you have to include the R switchrn(for recursive). To delete the folder TEST, you would issue the command rmrn-iR TEST. If you have an old Linux system about to recommissioned (andrnyou have all the data from the drive), you can have a little fun by issuing therncommand rm -rf / as the root user (or using sudo) and watch the entirerncontents of the machine vanish before your eyes. Don’t do this. Really… don’t.
Suppose that config file is named app.conf. To check thernfile for the string, you could issue the command grep LOCAL_LINUX_LOCALE app.conf.rnThe results would list the string, highlighted for easy spotting. And what if yournneeded to know the exact line number that contains the string? Just add the -nrnswitch, and it will print out the line number:
grep -n LOCAL_LINUX_LOCALE app.conf