OnlyOnePixel

Share this post

Navigating The Unix Terminal

onlyonepixel.substack.com
Software Engineering

Navigating The Unix Terminal

Shell Navigation #ALX-SE-001 #LectureNotes

Uchechukwu Emmanuel
Sep 22, 2022
2
2
Share this post

Navigating The Unix Terminal

onlyonepixel.substack.com

After reading this blog post, you should be able to:

  • Navigate in a Unix system

  • List files and directories

  • Display the content of a file

  • Create a file or directory

  • Remove a file or directory

  • Move or copy a file or directory


The Linux File System

Files on a Linux system are arranged in what is called a hierarchical directory structure. This means that they are organized in a tree-like pattern of directories (called folders in other systems), which may contain files and subdirectories. The first directory in the file system is called the root directory. The root directory contains files and subdirectories, which contain more files and subdirectories, and so on and so on.

Thanks for reading The Blue-Blooded Maverick! Subscribe for free to receive new posts and support my work.

Most graphical environments include a file manager program used to view and manipulate the contents of the file system.

Since the command line interface cannot provide graphic pictures of the file system structure, we must have a different way of representing it. To do this, think of the file system tree as a maze, and that we are standing in it. At any given moment, we are located in a single directory. Inside that directory, we can see its files and the pathway to its parent directory, and the pathways to the subdirectories of the directory in which we are standing.

:- to display the current path of your current directory

$ pwd

:- to list all files of your current directory

$ ls

:- to change to a music directory

$ cd /music

:- display the content of file.txt

$ less file.txt

:- to create an empty file

$ touch file.txt

:- copy a file (or directory if additional argument)
:- copy school.txt to tmp directory (in the same directory)

$ cp school.txt tmp/

:- to rename or move a file (or directory)
:- rename the file old.txt to new.txt (in the same directory)

$ mv old.txt new.txt

:- to delete a file (or directory if additional argument)
:- delete a kk.txt file

$ rm kk.txt

:- create a videos directory

$ mkdir videos

:- delete/remove an empty_directory

$ rmdir empty_directory

Man Page

A man page is a form of software documentation usually found on a Unix or Unix-like operating system. To view the documentation of a Unix command we use the man keyword/command on the terminal

$ man pwd
$ man ls
$ man cd
$ man less
$ man touch
$ man cp
$ man mv
$ man rm
$ man mkdir
$ man rmdir

THE END.


Thanks for reading The Blue-Blooded Maverick! Subscribe for free to receive new posts and support my work.

2
Share this post

Navigating The Unix Terminal

onlyonepixel.substack.com
2 Comments
Okoroafor Kelechi Divine
Sep 22, 2022

When I grow up, I want to be better than you.

Expand full comment
Reply
1 reply by Uchechukwu Emmanuel
1 more comment…
TopNewCommunity

No posts

Ready for more?

© 2023 Uchechukwu Emmanuel
Privacy ∙ Terms ∙ Collection notice
Start WritingGet the app
Substack is the home for great writing