Skip to content

naresh6557/Linux-Commands-Study

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

Cloud Security Lab 1: Linux Commands Study

Introduction to Linux

Linux is an open-source operating system, and its kernel is the heart of the OS, facilitating communication between hardware and software. One of the key advantages of Linux is its customizability; developers can modify the Linux kernel to create their own tailored operating systems.

Linux Commands

Linux commands are executed in the terminal, which is case-sensitive. This guide covers some basic and advanced commands used in Linux.

1. ls Command

The ls command is used to display a list of contents in a directory.

Syntax:

ls

Output: Screenshot 2025-03-21 081645

2. pwd Command

The pwd command displays the location of the current working directory.

Syntax:

pwd

Output: Screenshot 2025-03-21 081655

3. mkdir Command

The mkdir command is used to create a new directory.

Syntax:

mkdir <directory_name>

Output: Screenshot 2025-03-21 081746

4. rmdir Command

The rmdir command is used to delete a directory.

Syntax:

rmdir <directory_name>

Output: Screenshot 2025-03-21 081828

5. cd Command

The cd command is used to change the current directory.

Syntax:

cd <directory_name>

Output: Screenshot 2025-03-21 083644

6. cat Command

The cat command is used to create, display, and concatenate files.

Syntax:

cat [OPTION]... [FILE]...

Output: Screenshot 2025-03-21 084404

7. cp Command

The cp command is used to copy files or directories.

Syntax:

cp <source_file> <destination_file>

Output:

8. gedit Command

gedit is a general-purpose text editor used to create and edit text files.

Syntax:

gedit <file_name>

Output:

9. su Command

The su command provides administrative access to another user.

Syntax:

su <username>

Output:

10. mv Command

The mv command is used to move a file or directory from one location to another.

Syntax:

mv <file_name> <directory_path>

Output:

11. rename Command

The rename command is used to rename files.

Syntax:

rename 's/old-name/new-name/' <files>

Output:

12. head Command

The head command displays the first 10 lines of a file.

Syntax:

head <file_name>

Output: Screenshot 2025-03-21 083809

13. tail Command

The tail command displays the last 10 lines of a file.

Syntax:

tail <file_name>

Output: Screenshot 2025-03-21 083825

14. id Command

The id command displays the user ID (UID) and group ID (GID).

Syntax:

id

Output: Screenshot 2025-03-21 084711

15. grep Command

The grep command is used to search for a pattern within files.

Syntax:

command | grep <search_word>

Output:

16. tr Command

The tr command is used to translate or delete characters.

Syntax:

command | tr <old> <new>

Output:

17. chmod Command

The chmod command is used to change the access mode (permissions) of a file.

Syntax:

chmod <options> <permissions> <file_name>

Output:

18. tar Command

The tar command is used to create or extract archive files.

Syntax:

tar [options] [archive-file] [files_to_archive]

Output:

19. chown Command

The chown command is used to change the ownership of a file.

Syntax:

chown <owner_name> <file_name>

Output:

20. make Command

The make command is used to build and maintain groups of programs.

Syntax:

make [-f makefile] [options] [targets]

Output:

21. ifconfig Command

The ifconfig command is used to configure network interfaces.

Syntax:

ifconfig [options] [interface]

Output:

22. chmod 777 Command

The chmod 777 command gives read, write, and execute permissions to the owner, group, and others.

Syntax:

chmod 777 <file_name>
chmod -R 777 /path/to/file/or/folder

Output:

23. host Command

The host command is used to display the IP address for a given domain name.

Syntax:

host <domain_name> or <ip_address>

Output:

24. gzip Command

The gzip command is used to compress files, replacing the original file with a compressed one with a .gz extension.

Syntax:

gzip <file1> <file2> <file3>...

Output:

25. sort Command

The sort command is used to sort the contents of a file alphabetically.

Syntax:

sort <file_name>

Output:

26. cal Command

The cal command displays the current month's calendar with the current date highlighted.

Syntax:

cal

Output:

27. clear Command

The clear command clears the terminal screen.

Syntax:

clear

Output:

28. mail Command

The mail command is used to send emails from the command line.

Syntax:

mail

Output:

29. df Command

The df command displays the disk space usage of file systems.

Syntax:

df

Output:

30. find Command

The find command is used to search for files in a directory hierarchy.

Syntax:

find <directory> -name <file_name>

Output:

Result

About

To study and write a linux commands

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published