10 Basic Linux Commands You Can Put to Good Use

10 Basic Linux Commands You Can Put to Good Use

July 8

Slowly but surely, Linux is making its mark. W3Counter statistics from May, 2015 show a 2.74 percent share of the OS market, which is lower than Windows XP, yet actually higher than Windows 8. I honestly believe adoption will pick up as users continually look to migrate to more affordable and flexible OS environments. If you’re one of them, you can benefit by getting familiar with some basic Linux commands.

Many modern Linux distros offer convenient point-and-click computing thanks to GUIs reminiscent of Mac OS X and Windows. Be that as it may, an old school administrator may argue that command line computing delivers a more stable, scalable, and flexible computing experience. Type in your instructions, hit “Enter”, and marvel as the machine works its magic. Once mastered, the following Linux commands list will have newbies feeling like seasoned maestros behind the computer.

1. cd: The change directory (cd) command allows you to switch between file directories. You can jump to a new directory by entering “cd” followed by the name or path name of the directory you want to access, which depends on where you are in the hierarchy. Of all Linux commands, you may find yourself using this one most often as it provides the ability to easily navigate the file hierarchy of your system.

2. ls: The list (ls) command lists the folders and files in a given directory. Tweaked to “ls -al”, it will list all the files in the current directory, complete with metadata such as file size, time, date, and permissions.

3. cp: The cp command allows you to copy files and entire directories from the command line. So for instance, if you want to copy a file named “image.jpg”, you can run the command “cp image.jpg image-01.jpg”. In this example, image.jpg and image-01.jpg respectively represent the original file and the copy you just created, both of which now exist in the directory you’re working in.

4. mv: In the Windows environment, moving files between directories is usually as simple and dragging and dropping them where you want them. The same goal can be accomplished from the command line in Linux. So if the file “NextArticle” mistakenly ended up in your home directory, you can transport it to your documents folder by running the command “mv /home/user/NextArticle /home/user/Documents/”. The move command can also be used to rename files while keeping them in the same location.

5. ps: The ps command pulls up the processes running on your Linux system. You can customize how those processes are displayed by modifying the original command a bit. For example, you can run the command “ps ax” to pull up a full list of active processes.

6. Kill: The kill command is a signal that tells the system to pull the plug on a troublesome app. There are dozens of these signals, but you can argue that SIGKILL(9),which instantly kills the process, yields the most power. This next example will use two of our Linux commands. I can run the “ps ux” command to bring up all my running applications and their process identifier (PID). So going by the PID of the app in question, I can enter kill -9 2735 to stop the process.

The process killer I like even more is PKIll. This one lets you target and zap processes by name. So if it’s Chrome that’s acting up, you can simply run the command: “pkill chrome” and bam … it’s gone!

7. shutdown -r now: Once entered, Linux commands are often executed with no warning or reversal. That’s the case with the shutdown command, which will immediately shut down and reboot the system. Make sure you’ve saved your work before running it.

8. Exit: Shell applications like Bash and ROXTerm give you a couple of easy ways to close down the terminal session.The original Unix shell is a lot more scaled down,which may leave you feeling like there’s no way out. No matter what shell environment you’re stuck with, a simple “Exit” command will allow you to escape when you’re ready to call it quits.

9. Clear: If you’re anything like me, you’ll find some way to butcher the most basic Linux commands.Before you know it, your terminal is chock full of “command not found” errors. Thank goodness for the undo command. Simply type “Clear” into the command line, and you’ll instantly have a clean slate of whatever directory you’re working in.

10. Man: All this Linux jargon confusing to you? Well there’s a command for that. The man command allows you to retrieve manuals on the commands you’re using. So “man mv” would give you some background info on the mv command and how to get the most from it.

There you have it. A Linux commands list the most inexperienced of users can handle. Maybe one day we’ll cover some advanced CLI instructions that allow you to really tap into the power of your distro.

Photo Credit: Linux Screenshots via Flickr