Skip to content

A Linux command refers to a program or utility that runs in the command-line interface(CLI). The CLI is a text-based environment where you interact with the system by typing commands.

Notifications You must be signed in to change notification settings

jonesedem/Linux-Commands-Deep-Drive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

Basic-Linux-Commands

A Linux command refers to a program or utility that runs in the command-line interface(CLI). The CLI is a text-based environment where you interact with the system by typing commands.

CommandName [option(s)][parameter(s)]

Manipulating files and directories on Linux

The sudo command

In Linux some actions need special permission to be carried out, like creating files in certain areas or changing important system settings. This is where the sudo command comes into play.

sudo stands for superuser do and it allows you to run commands with the security privileges of another user, typically called the superuser or root. sudo helps in keeping the system secure by limiting access to powerful commands and logs who executed which command, adding a layer of accountability.

Creating a Folder with sudo:

ssh into aws remote server (ec2)

1  ssh to aws server

create a folder example in /root without sudo

2  permission denied error

create a folder example in /root with sudo

3  example dir

pwd command

Use the pwd command to find the path of your current working directory

4  pwd

The Linux directory structure

At the top of the Linux filesystem hierarchy is the root directory, denoted by a single slash '/'

/bin: Essential user command binaries(programs) that need to be available to all users command are stored here (eg. ls, cp etc)

/etc: Configuration files for the system can be found in here.

/home: Personal directories for users.

/root: The home directory for the root user.

/var: Variable data like logs

/usr: Secondary hierarchy for user data

cd command:

To navigate through the Linux files and directories.

5  root files

display /usr directory

6  cd usr

Side Hustle Task1:

create a directory called photos inside the /usr directory

7  create photo directory

navigate into the photo directory

8  cd photos

create 3 more random directories insde the photos directory and display them

9  create 3 folders

Navigate into one of the folder and show the full path

10  folder path

ls command:

The ls command lists files and directories.

11  ls command

cat command

Concatenate or cat is one of the most frequently used Linux commands. It lists, combines, and writes file content to the standard output.

12  cat etc file

cp command

use the cp command to copy files or directories and their content

13  cp filename

copy file to a folder

14  copies multiple files

copy multiple files to a folder

14  copies multiple files

copy from one file to another

15  copy from file 1 to 2

copy from one directory to another

16  cp directory to directory

mv command

The primary use of the mv command is to move and rename files and directories

move a file to a directory

17  mv file to directory

rename a file

18  rename new file

rm command

The rm command is used to delete files within a directory

remove a single file

19  rm file

remove multiple file

20  rm multiple file

touch command

The touch command allows you to create an empty file.

21  touch

find command use the find command to searchfor file within a specific directory and perform subsequent operations.

General syntax for fine: find [option] [path][expression]

22  find

About

A Linux command refers to a program or utility that runs in the command-line interface(CLI). The CLI is a text-based environment where you interact with the system by typing commands.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published