Chromebooks aren’t alone with the Google Chrome browser anymore. They now have the ever-green support of the Google Play Store and Linux to back them up and incorporate a ton of functionality. This speedy operating system now performs better than ever, as users can install Microsoft Visual Studio Code for programming and writing code, play Nintendo DS games, run WordPress, and even operate the Ultimaker Cura slicer software for 3D printing. All that is mostly possible because of the built-in Linux feature that has made landfall on Chromebooks in Chrome OS 69 almost 3 years ago.
- There’s a catch with using Linux on Chrome OS, and that is compatibility. Unfortunately, not every Chromebook ever made supports the feature of Linux. To find out if your device makes the cut, check out this guide.
Linux is capable of a lot more, and experienced users reading this are already aware of that. However, the Linux Terminal on Chrome OS can appear quite confusing to most casual people, so you should be aware of some basic yet useful commands to help you find your way with Linux. In this article, therefore, we will highlight the top 20 Linux commands to learn and use on your Chromebook. But, before we get into that, let’s cast a lens on what Linux is and how do you set it up on Chrome OS.
What is Linux Terminal on Chrome OS?
The Linux Terminal is a specialized development environment where users can build software and run command-line tools. It is a high-powered program that developers and other like-minded users can utilize to operate Linux and get the best of it.
The Linux Terminal can be accessed easily on your Chromebook. Fortunately, we have covered the entire topic in one of our articles here, so do give it a read if you want to acquire all the technical know-how related to Linux.
With the basic introduction out of the way, let’s now get into the top 20 commands you should be using to use Linux with full efficiency.
Utilize Linux to the full with these 20 commands
Before we start dishing out the top 20 commands, you must know where your Linux Terminal is and how you can launch it.
The Linux Terminal can be found in your Chromebook’s “Launcher,” which is depicted by a circular graphic in the bottom-left corner of the Chrome OS interface. When you click on it, all of your applications will manifest, although you will have to click on another arrow to expand to the area of your device’s apps fully.
Next, all that’s left is to open the Terminal. You will find it in the “Linux apps” folder in the Launcher.
That’s it! You’re all set for inputting Linux commands in your Terminal. Click on the app icon shown above and the Terminal should pop-up.
1. Update Linux Terminal
The command for updating your Linux Terminal is one of the most important, if not THE most important altogether, ones that you probably should know about before any other command. Put, and an updated Terminal ought to bring you the best results and is exceedingly less prone to run into errors potentially. So, here’s how you update the Linux Terminal.
sudo apt-get update
As a plus, you can also upgrade your Terminal’s packages separately, so its performance is always up to speed. Use the following command to do that.
sudo apt-get dist-upgrade
2. Access the available contents of Linux directories
Another exceedingly common command that every Linux user should be aware of is “ls,” better known as “list.” The list command is popularly used to view the available information of a specific directory. It lets you access both files and directories, depending on what you require at the moment. To get started with this command, type in the following in your Terminal and press the “Enter” key.
ls
There’s one other noteworthy variation of the “list” command that lets you view hidden files of your directory. To gain access to the content concealed away from plain sight, use the following command.
ls -a
Lastly, you should also know about another variation of the “list” command that lets you view the available files of a directory in the order in which they were modified. This is particularly useful when you lend someone your Chromebook, and you want to check whether they have been experimenting with your device or not. Use the following command to sort your directory information accordingly.
ls -c
3. Create a new directory
You can also create new directories in Terminal using a simple command. This is basic yet highly useful because new folders are needed oftentimes, so you should be prepared ahead of this situation. To create a new directory or folder, enter the following command in your Terminal and press the “Enter” key.
mkdir "enter folder name"
4. Change the directory
It’s of the utmost necessity that you know how to change your Linux directors so you can navigate around the system efficiently. Without this pivotal command, you’d be left wondering how to get from one directory to the other and would’ve had no idea how to browse the file system. Use the following command, therefore, to dispel such predicaments beforehand.
cd
5. Remove a directory
When you create new folders or directories, you need to know how to delete them as well. Use the following command to remove a specific folder or directory easily.
rmdir
6. View disk information
The next command on the list pertains to the information of your Chromebook’s disk space and is called “disk free.” To pull up all the relevant information relating to the disk storage, use the following command.
df "enter folder name"
7. View the name of your current directory
Operating Linux can get hefty at times, and it’s rather easy to get lost in the world of the Terminal. In that case, it’s a great idea to use a command that would pull up the name of your working directory. Therefore, use the following informative command to get your directory’s absolute address, which, in simple terms, is the full address of your directory.
pwd
8. Access information related to a Linux command
Linux commands come with a manual to teach users the in-depth specifics of that command. You’ll typically get a description of how the command works, what it is, and available options for the diverse supports of the command. Type in the following in your Terminal along with the name of the command to get going.
man "enter command name"
9. Clear your Terminal window
If you’re an avid Linux user, it’s normal for the Terminal screen to get cluttered and filled with strings of text and information. Luckily, there’s a highly effective command that refreshes your Terminal window by clearing all the commands and restoring it to its original state.
clear
10. Move files in Linux
Moving files through the Terminal is effortless. You can use the following command, followed by entering the name of the file you want to move, and finally, the name of the file you want to move it to. If you input the command correctly, you should be able to see the file moved instantaneously.
mv "name of file you want to move" "name of folder you want to move file to"
11. Copy and paste the files in the Terminal
This command is similar to the command we’ve talked about above, but it lets you copy and paste the file you want to, where you want to, instead of moving it. Use the following command to get going with copying and pasting.
cp "nae of file you want to copy" "name of folder you want to move file to"
12. Open the contents of a text file
In Linux, it’s outright facile to view information regarding a specific text file. Think of the following command as a detailed read-only description of any file you’d like to cast a lens on. Apart from viewing, you can use the command to create, edit, and do much more, so this is something that should be present in your arsenal of important Linux commands.
cat "name of file"
13. Import downloads directly from the web
There’s a superbly useful Linux command that lets you begin downloading a certain application or program directly within the Terminal without you having to download its AppImage or go through the banal process of moving the relevant file to the “Linux files” folder in your Chromebook.
wget "enter download address/link"
14. Categorize displayed information
It’s not uncommon to see you bombarded with huge blocks of text and likewise information in the Linux Terminal. Unless you’re a robot, we humans should read the information in a categorized manner. When things are in good order and shape, the brain is more susceptible to understanding them. Therefore, we’ll be combining two commands using the pipeline key depicted by “|” to firstly open the contents of a text file and then organize it.
cat "name of file" | less
15. Search for a word or string within a file
If you’re an experienced computer user, you know how “CTRL+F” works wonders for finding desired words on a web page. In Linux, the contents of some files can get pretty expansive, so if you want to size them down to your liking and only look for something specific, the “grep” command is just for you. It’s also recommended for those interested in Linux shell scripting, so this command is definitely worth knowing.
grep "word you want to search" "the file/directory you want to search in"
16. Get the history of all your entered commands
If you’re a late worker or find yourself tinkering around with the Linux Terminal quite a few times, you need to know how to pull up the history of all of your entered Terminal commands. The command itself is self-explanatory since it’s literally “history.”
history
There’s another neat trick with the history command that lets you operate the Terminal more efficiently. When you pull up your command history, you will see that each command has a number beside it. Thus, you can quickly input that command in your Terminal window by using the following. Note that there is no space between the exclamation mark and the number.
!"enter relevant command number"
Use the following command if you intend to clear up your history as you would on the Google Chrome browser.
history -c
17. Display information of all running processes
Linux has a Task Manager of its own as well. Using the following handy command, you can prompt the Terminal to show you the list of all those processes currently running on your Chromebook. The “Process Status” command not only displays the name of those system processes but also enlists information about them.
ps -aux
Combining a command we mentioned earlier, you can categorize the information presented before you in an orderly fashion. Let’s take a look at this combo below.
ps -aux | less
You can also run the following command in the Linux Terminal to get a list of all the processes utilizing your CPU. If you suspect that something is slowing your Chromebook down, this command can help you close in on the area of issue.
top
18. Terminate processes
Once you’ve identified the source of your high CPU usage, you can easily “kill” it by using the following command. This is particularly useful when you want to terminate a process, similar to how you would do it on a Chromebook’s Task Manager. However, to pull off this command successfully, you will first need the PID number of the process you want to terminate. To get the PID number, you will use the aforementioned “top” command. That should give you the PID number of all the processes currently running on your device.
kill "enter PID number"
19. Bypass Linux restrictions
One of the best commands in Linux is “sudo.” It allows you to become a superuser momentarily and bypass restrictions and gain access to privileges comfortably. Using this command, you can install Linux applications without breaking a sweat. For example, the following is how you install GIMP – a high-quality photo-editing tool that’s sprawling with features.
sudo apt-get install GIMP
20. Turn off Linux
After a hard day at work with Linux on your Chromebook, it’s understandable that you want to shut your computer down as soon as you can. To help you shut down Linux on the fly, you can type the following command easily and power off the Terminal just like that.
shutdown
Another awesome variation of the “shutdown” command is to implement time in it. That way, you will direct the Terminal to turn off automatically after a set period of time has passed. For instance, if you want to make Linux shut down after 3 minutes, you will use the following command.
shut down -t 180
Conclusion
Linux has made the thought of shifting to a Chromebook better than ever. This swift operating system now boasts the Terminal’s functionality, not to mention the convenience of the world of Android applications. That said, operating Linux effectively is no walk in the park, and even skilled experts often find them riled up when developing software gets tough and onerous. However, when you have your basics strong, overcoming any task—whatever it may be—becomes less of a daunting beast.
In this article, we have shown you the top 20 Linux commands to learn and use on your Chromebook to get around the Terminal faster than ever, especially if you’re a beginner trying to learn programming and everything of the like. Be sure to implement each of these commands in your daily routine of using Linux to get the hang of them quicker and become a more efficient Terminal user. With all that being covered, Chrome Ready wishes you a happy Linux-ing!