Skip to main content

Linux commands for navigating the file system

Navigating Linux File System


https://i.ytimg.com/vi/U1lhEmwE7io/maxresdefault.jpg
Linux is most probably the most used operating system when it comes to development. Learning how to navigate the Linux file system can really benefit if you plan on using linux as you primary operating system or for development purposes

Basic Commands

1. pwd: print the name of the current working directory on the terminal

Use this command to find out where you are in the directory structure. When you log on to Linux, your starting  directory is always your home directory, so you will be in /home/[your username] as any other than root, or /root if you are logged in as root.

    pwd


2) ls: list the contents of the current working directory

ls command is the most used ls command in Linux. It is the command that most people use once they are logged in a Linux system.

To see what files we have in the current working directory we can use the "ls" command


To see all the hidden files ( those starting with a period ), use the following switch:

    ls -a



3) cd: change directory

To change our current working directory we use the "cd" command. To be able to change tho current working directory type "cd"  followed by the pathname  of the new directory to which you wand to go to.Linux uses two symbols to represent the current directory and and it's parent directory in the file system. These symbols are "." which refers to the working directory and ".." symbol which refers to the parent directory of the working directory.

     cd /usr/bin


To change to the parent directory of the current directory you are in just use the below command

    cd ..

the above command has the ".." that is to indicate the parent directory that you are currently working  on.

Shortcut to home directory:

The symbol "~" represents the home directory of the user

this is how it is used
        cd ~


or you can just use the "cd " command without the "~" symbol


Comments

Post a Comment

Popular posts from this blog

TTY in linux and how to use it

Ok, how about we start with what is TTY.It stands for “teletypewriter.” What can tty tell us. In Linux, there is a pseudo-teletype multiplexor which handles the connections from all of the terminal window pseudo-teletypes (PTS). The multiplexor is the master, and the PTS are the "slaves". The multiplexor is addressed by the kernel through the device file located at /dev/ptmx. The tty command will print the name of the device file that your pseudo-teletype slave is using to interface to the master. And that, effectively, is the number of your terminal window. The output shows that we are connected to to the device file at /dev/pts/4. Our terminal window, which is a software emulation of a teletype (TTY), is interfaced to the pseudo-teletype multiplexor as a pseudo-teletype (PTS). And it happens to be number four.For the number at the end shows that. The Silent Option . The -s (silent) option causes tty to generate no output. This is how it will look on your terminal It do...

Virtualization Technology

    Virtualization is the process of running a virtual instance of a computer system in an abstract layer of the physical hardware.     It ensures efficient utilization of physical computer hardware and is the foundation of cloud computing.     Virtualization uses a software to create an abstraction layer over computer hardware that allows the hardware  elements of a single computer  such as processor, memory , storage and more to be divided into multiple virtual computers , commonly called virtual machines(VMs)     Each VM  runs its own operating system and behaves like an independent computer, even though it is running on just a portion of the actual underlying hardware.     This is the technology that drives the cloud computing economics. This enables cloud providers to serve users with their existing physical computer hardware; it enables cloud users to purchase only the computer in resources they need when ...

Improve your Efficiency in Linux using "Alias" command

Have you ever tried to make a custom  command in Linux that can do a specific function. Fear not today we are going to look at how we can do that and increase our efficiency in Linux using the "alias" command What is an alias in Linux So,normally we have to use Linux commands frequently and typing the same commands over and over again can reduce efficiency .And that is one of the reasons we use the aliases List currently defined Aliases in Linux You can see a list of defined aliases on your profile  by simply executing the alias command and it will do the magic. here you can see the default aliases for the Linux systems. How to create Aliases in Linux. Create temporary Aliases:           alias alias_name='command' here is an actual example          alias la='ls -alh' What you need to do is type the word alias then use the name you wish to use to execute a command followed by "=" sign and quote the command you wish to...