Getting Started with Linux Terminal

Student @ National Institute of Technology, Delhi.
Android | Kotlin | Go | Python
Search for a command to run...

Student @ National Institute of Technology, Delhi.
Android | Kotlin | Go | Python
No comments yet. Be the first to comment.
Failures are Inevitable Network calls might time out, APIs might be temporarily unavailable, or databases might become unreachable. To handle such transient errors gracefully, implementing a retry mechanism is crucial. This article will guide you thr...

In the last article, we covered data classes in Kotlin. We saw how they simplify class creation and make it faster with less coding. Now, let's explore Sealed Classes. Sealed Classes in Kotlin are a specialized form of abstract classes. They limit su...

Efficient Data Structuring in Android Development with Kotlin's Data Classes

Learn about Kotlin type hierarchy, type checks and type casts

Understanding and Utilizing Polymorphism and Inheritance in Kotlin for Effective Development

Hello there, In this article, we'll take a look at some of the basic commands used in Linux-based systems.

hardik@nitro5-fedora. Here hardik is the username of the logged-in user and nitro5-fedora is the name of the pc.~ indicates that we are in the home directory./ indicates that we are at the root of the filesystem.$ symbol indicates that you are interacting with the system as a regular user. If you have sudo privileges, the $ turns into a #.NOTE: From here on now, I’ll be using zsh instead of bash. But don't go away just yet. The commands discussed here work just the same on bash as well. :P
date command is used to show the current system date and time.

ls command lists the files present in the current directory.

Let’s take a look at some important flags for ls command
-R
This flag lists the files recursively i.e. it will also list the file present in subdirectories and their subdirectories and so on
Here’s a sample

-l
This flag shows some additional information about the files like permission string, owner, group of the owner, file size in bytes

-a
This flag lists hidden files as well

cat command is used to display, copy, combine and create new files.
Creating new files

Viewing a file

Combining two files

pwd stands for print working directory and does the same.

rm is used to delete files. rmdir can be used to delete directories.

You can use -rf flag to delete a directory recursively.

cd stands for change directory and is used to do the same.

Please ignore the warnings. They are related to my prompt configuration.
Some important cd commands
cd .. is used to navigate to one level up in file system.cd ~ navigates you to your home folder.mkdir is used to create a new directory.

mv stands for move. It is used to move files around the file system. It can also be used to rename files
SYNTAX
mv [OPTIONS] source destination

cp stands for copy and is used to copy files and folders
SYNTAX
cp [OPTIONS] source destination

man command is used to access documentation of the commands that are available in the os. Here is a sample
man curl

To exit this page, press q
history command shows the commands used in this terminal session.

clear command clears the terminal. In modern terminal emulators, you can press Ctrl + L to do the same.
Hope you liked this short article. See you next time. :D