IT Blog

IT Support Linux

Starting With Linux

Linux was developed by young Linus Torvalds when he was a computer science student. He used to work on the UNIX OS and thought that it needed improvements. He had sent many suggestions to the Unix team but they were not taken to consideration.

Linus Torvalds

When his suggestions were rejected by the designers of UNIX, he thought of launching an OS that will be receptive to changes, modifications suggested by its users.

Linus devised a Kernel named Linux in 1991. Though he had the operating system there were applications like file manager, document editors,audio-video programs to run on it.

But as time passed by Linus collaborated with programmers from MIT and applications for Linux started to appear. So around 1991 Linux OS was launched officially with some applications and it was the most loved open-source option available.

The main advantage of Linux was that programmers were able to use the Linux kernel to design their own custom operating systems. With time, a new range of user-friendly OSs stormed the computer world. Currently, Linux is one of the most popular and widely used kernels, and it is the backbone of popular operating systems like Debian, Knoppix, Ubuntu, and SUSE.

Structure Of Linux OS

Linux Basic commands :

When we think about Linux the first thing which comes to our mind is the complicated operating system that is used by programmers. But it’s not as scary as it seems.

When operating a Linux OS, you need a shell – an interface that gives you access to the operating system’s services. Most Linux OSs use a GUI as their shell, mainly to provide ease of use for their users.

Even though there is a GUI it is recommended to use the command-line interface (CLI) because it’s more powerful and effective. Tasks that require a multi-step process through GUI can be done in a matter of seconds by using CLI.

Now let’s learn few basic command lines which will definitely help you to navigate through Linux as a newbie.

For using the commands you have to open the “terminal” in Linux.

  • pwd – Use the pwd command to find the current path that your working on. It will return to you the absolute path.Example /home/username
  • cd – We use the cd command to navigate through the directories and files in Linux. Example ,say you’re in /home/nifty/documents and you want open photos (a subdirectory in documents). To do so,simply type the following command “cd photos”.

Another scenario is when you want to go completely different directory. Example, /home/nifty/movies. In this case, type “cd absolute path”

There are some shortcuts to help you navigate quickly:

cd .. (To move one directory up)

cd (to go straight to the home folder)

cd- (to move to your previous directory)

Note: Linux shell is case sensitive. So, you have to type the name exactly as it is.

  • ls – This commend is used to view the contents of a directory. By default this command will view the contents of your current directory.

The variants of the ls command are mentioned below :

ls -R (Will list all files in the subdirectories as well)

ls -a (Shows the hidden files)

ls -al (will list the files and directories with detailed information)

  • cat – It is used to list the contents of a file on the standard output. Example: cat filename.txt

Other ways to use cats:

cat > filename (Creates a new file)

cat filename1 filename2>filename3 (Join 2 files 1 and 2 and stores the result in file 3)

Cat filename | tr a-z A-Z >file.txt (will convert a file to uppercase or lowercase)

  • cp – This command is used to copy files from the current directory to a different directory.

Example: cp scenery.jpg /home/nifty/photos would copy scenery.jpg into the photos directory.

  • mv – mv command is used to move files and also rename files

The arguments in mv are similar to the cp command. You need to type mv, the file’s name, and the destination directory.

Example: mv filename.txt /home/nifty/Documents

To rename , mv oldname.ext newname.ext

  • mkdir – mikdir is used to make a new directory – if we type mkdir music it will create a directory called music.
  • rmdir – this command is used to delete a directory. However,rmdir only allows you to delete empty directories.
  • rm – rm command is used to delete directories and the contents with them.If you only  want to delete the directory -as an alternative to rmdir – use rm -r.

Note: Double-check before doing it because there is no undo

  • touch – This command allows you to create a blank new file through the Linux command line. Example: touch /home/nifty/Documents/file.txt
  • locate – You can use this command to locate a file,just like the search command in windows.You can use -I argument along with this command to make it case-sensitive,so you can search for a file even if you don’t remember it’s exact name.

Leave a Reply

Your email address will not be published. Required fields are marked *