Basic Linux Commands
There are so many Linux commands that can be entered at the bash Terminal prompt that keeping them all in your head can be much like learning a foreign language. The similarities are obvious – they look like English, you can pronounce the commands, but using them in the right manner with the correct syntax can be a challenge.
Fortunately some of the best commands to learn come when setting up a Linux computer, such as setting the hostname, adding a user and setting file permissions. Don’t forget that you should also learn how to navigate between directories from the command line, using the cd function to change directory and ls to list the contents.
- Understand the hostname Linux Function
- Add New Linux Users with adduser
- Linux Command Line: chmod
- Linux Command Line: mount/umount
- Change Directory with the cd Command
- Listing Directory Contents in Linux: ls
Building Your Familiarity with Linux Commands
There’s more that you can do with Linux commands to take the learning experience further. One example is to change your computer’s name, as well as engaging in common renaming tasks such as changing directories. You might even be interested in altering your IP address, a useful tool if you decide to switch from a dynamic to static IP address.
- Ubuntu: Changing Your Computer’s Name
- How to Change a UID in Linux
- Renaming Directories in Linux
- IP Address Configuration in CentOS
The Tough Commands with Forgettable Names
Many of the most powerful Linux commands date from the early days of the open source operating system, and as such they have been given names that while describing their purpose are nevertheless quite unfriendly. Anyone coming to Linux who wishes to get to grips with the command line will need to pay particular attention to this group of functions.
- Linux Command Line: nano
- The Linux dd Command
- What is the Linux df Function?
- Linux Command Line: ssh
Commands for Installing Software
The various Linux GUIs have plenty of options for installing and removing software in the shape of tools such as RPM, Ubuntu Software Center and Synaptic Package Manager. However these tools represent the tip of the iceberg when it comes to methods of installing new applications. The apt-get command is particularly well powerful and ideal for installing software via the Terminal or perhaps via SSH.
- Installing Software with apt-get
- Using rpm to Install Apps in Linux
- Linux Command Line: Urpmi
- The Linux wget Function
- Make a New Directory with mkdir
- Linux Command Line: history
Managing Your Linux Processes
Understanding what your Linux computer is doing when you’re running applications will help you to identify any performance issues. These can be highlighted by accessing commands such as top, which displays as much information about memory and resources as you can handle.
Another process that many Linux users can be completely unaware of is startx, which handles the X session on your computer – this controls the graphical user interface. As most Linux distros have a GUI the startx function is usually running, but anyone with an interest in command line functions should know how to invoke it.
- Displaying Memory Usage by Process
- Manage Linux Processes with top
- Linux Command Line: diff
- Linux Command Line: ln
- Kick-startx Your Linux GUI
Further Command Line Functions You Shouldn’t Forget
When you are most used to using a GUI, you will probably find that most of the tasks you carry out use the mouse and keyboard. For instance, you might use the mouse to open a search box in a document or text file and then type the string you’re looking for.
In the Terminal the difference is that there is no GUI, so some of the commands tend to be slightly complicated. This is the case with grep, which is used for finding text strings in files.
Another memorable function that you shouldn’t forget is rm, which is used for removing files that you no longer need.
- The Linux grep Function
- Using the rm Command in Linux
- Linux locate Function
- Linux Command Line: cat
- Linux Command Line: which
More Memorable Commands That You Won’t Forget
The more you use Linux text functions, the harder it will be to forget them. One that you should never forget is sudo, which indicates to the computer that you wish to run a task as super user.
For some interesting time-based functions, the at and cron functions are also available to Linux users.
- Super User Privileges with sudo
- What Does gpg Do?
- Modifying Permissions with chown
- Linux Command Line: at
- What Does Cron/Crontab Do?
Security and More
You should not forget the importance of security to your Linux installation, regardless of whether you are inputting text commands in your chosen shell or using the mouse in the GUI. The iptables tool is a popular way of specifying very particular firewall rules.
Using the tar function meanwhile will enable you to archive and unpack tarball (TGZ) files, very useful for any number of Linux related tasks from archiving your own data to preparing a download for installation.
- Let iptables Help Secure Your Linux Box
- Linux Command Line: tar
- Using bzip2/bunzip2 Compression
- The Linux aterm Function Explained
- Linux Command Line: g++
PDFs and Printing
Don’t think that just because you’re using the Terminal that there is no relation to what is happening in the main window of your Linux box. After all, PDF files can’t be read in a command line – but they can be created with the ps2pdf function. Even better, multiple PDFs can be combined with a simple bash command!
Similarly, you don’t have to open a document in the GUI to print it, simply call the printer from the command line, specify the document and wait for the results to be output.
- Create PDF Files with ps2pdf
- Combining PDFs in the Shell
- The Basics of Linux Printing From the Command Line
Hardware and File Management
Managing your hardware is just as important in Linux as in any other operating system, and by using the right commands you can find out some very interesting information about your PC’s components. For instance, information about CD drives and hard disk drives can be interrogated via the Terminal.
You can also control your hardware for a much more constructive use by configuring them to conserve power with special commands that are built into some Linux distros.
- Interrogate Your Disk Drives in Linux!
- Saving Power with Suspend/Hibernate Commands in Linux
- How to Use the Linux Date Command Within a Terminal
- Moving And Copying Files In Linux
Command Line Tricks: Rip Discs and Uninstall Software
As you may have guessed, we’ve been slowly moving away from the more specialist terms to presenting various Linux commands in the context of day-to-day use, and nothing can be more day-to-day than ripping audio CDs or playing music!
Even if you don’t want to take advantage of these text-based functions it will be useful to know that they are available just as being aware of the various file and application removal tools that can be employed should save you time when it comes to discarding with old software.
- Save Keystrokes: Using Aliases in Linux
- Ripping Audio CDs at the Command Line
- Listen to Music from the Command Line - mplayer, mpg123 and mp3blaster
- Linux Command Line: cruft-remover
- Using the Linux version Command
- Undelete Files in Ubuntu Using Foremost
- Screenshots provided by author.