pwd: Print the current working directory.
ls: List the files and directories in the current directory.
- To list hidden files, use
ls -a
.
- To list hidden files, use
cd: Change the current directory.
To go to the home directory, use
cd ~
.To go up one directory, use
cd ..
.
mkdir: Create a new directory.
- For example,
mkdir my_directory
will create a directory named "my_directory".
- For example,
touch: Create an empty file.
- For example,
touch my_file.txt
will create a file named "my_file.txt".
- For example,
rm: Remove files or directories.
To remove a file, use
rm filename
.To remove a directory and its contents, use
rm -r directoryname
(be careful with this command).
cp: Copy files or directories.
To copy a file, use
cp source file destination
.To copy a directory and its contents, use
cp -r source directory destination
.
mv: Move or rename files or directories.
To move a file or directory, use
mv source destination
.To rename a file or directory, use
mv oldname newname
.
cat: Display the contents of a file.
- For example,
cat my_file.txt
will display the contents of "my_file.txt".
- For example,
grep: Search for text within files.
- For example,
grep "search_term" filename
will search for "search_term" in "filename".
- For example,
man: Access the manual pages for a command.
- For example,
man ls
will display the manual for thels
command.
- For example,
ps: List running processes.
ps aux
will display a list of all running processes.
kill: Terminate a process.
- Use
kill process_id
to send a signal to a process to stop it.
- Use
chmod: Change file permissions.
- For example,
chmod 755 myfile
will give read, write, and execute permissions to the owner and read and execute permissions to others.
- For example,
chown: Change file ownership.
- For example,
chown user:group myfile
will change the owner and group of "myfile."
- For example,
Day 3 of #90DaysOfDevOps ( Basic Linux Command )
hope you liked it .......
#DevOps #Cloud #90DaysOfDevOps
#linux #Linux #DevOps #linux #cloud #LinuxVsWindows
#operatingsystem #90daysofdevops #tws