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)]
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.
ssh into aws remote server (ec2)
create a folder example in /root without sudo
create a folder example in /root with sudo
Use the pwd command to find the path of your current working directory
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
To navigate through the Linux files and directories.
display /usr directory
create a directory called photos inside the /usr directory
navigate into the photo directory
create 3 more random directories insde the photos directory and display them
Navigate into one of the folder and show the full path
The ls command lists files and directories.
Concatenate or cat is one of the most frequently used Linux commands. It lists, combines, and writes file content to the standard output.
use the cp command to copy files or directories and their content
copy file to a folder
copy multiple files to a folder
copy from one file to another
copy from one directory to another
The primary use of the mv command is to move and rename files and directories
move a file to a directory
rename a file
The rm command is used to delete files within a directory
remove a single file
remove multiple file
The touch command allows you to create an empty file.
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]