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

What is session hijacking and how to prevent it.

What is session hijacking Session hijacking is a type of web attack where an attacker takes advantage of an active session.The attack relies on the knowledge of your session cookie, so it is also called cookie hijacking or cookie side-jacking. Although any computer session could be hijacked, session hijacking most commonly applies to browser sessions and web applications. In most cases when we log in web applications, the server always sets a temporary session cookie in your browser to remember you are currently logged in and authenticated. For an attacker to perform session hijacking, he or she needs to know your session id.This can be done by stealing the session cookie or by persuading the user to click on an malicious link.In both cases the attacker can take over the session by using the same session id on his own browser session.And with that  the server has been fooled into treating the attackers session to be the original valid connection. What are the main methods of Sess...

What are browser cookies and how they work

INTRODUCTION. Most internet users are familiar with the term Cookie because we see it pop up in most websites but do we know the purpose it serves. Let us start with what it is ,   a cookie (  also known as browser cookie , internet cookie , web cookie or HTTP cookie ) is small piece of data that websites store on your disk in the form of a text file.Cookies allow websites to store specific information helpful to remember each visitor uniquely. What do browser cookies do. The purpose of the computer cookie is to help the website track of your visits and activity and is not a bad thing.A good example are the online retailers to keep track of the items in user's shopping cart as they explore the site, without the cookies the shopping cart would reset to zero with every click. A website also uses the cookies to store information about you recent visits or record you login information which i do not really recommend from a security perspective Types of browser cookies. Session co...