Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update basic_linux_commands.md #208

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion 2023/day02/basic_linux_commands.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,51 @@
## Basic linux commands

Uname commands and it's varients:--
-``` uname option_flag ----> It will display OS related information..
Examples:

-``` uname --> It wil display which Operating system i logged in.
- `` uname -m --> It will display microsystem name details
- ```uname -r --> It will display the kernal version
- ```uname -n --> It will display the hostname of the Operating System..
- ```uname -a --> It will display all the details related to the Operating System,like as mentioned below
-`````Kernelname Hostname Kernalrelease Kernalversion machinehardware(microsystemname) Operatingsystemname..
-`````whoami---> It will display switched username or child name


### Listing commands
```ls option_flag arguments ```--> list the sub directories and files avaiable in the present directory

Examples:

- ``` ls -l ```--> list the files and directories in long list format with extra information
- ``` ls -l ```--> list the files and directories in long list format with extra information. It has seven fields Where as the first field represents the type of object. In the first field it has 10 coloumns, here 1st coloumn represents whether the object is directory, regular file,charector device, link, socket or block device.
- " - `` It represents regular file and d--> directory, c--> charector device, l--> link s--> socket, b --> block device ``
- " 2nd field represents link(hard link).3rd field represents username. 4th field---> groupname 5th field---> size of file,6th field--> file's last modification time and the 7th field--> file name. for example
- [root@localhost devops]# ls -lrt
total 36
-rw-r--r-- 1 root root 12 Jun 3 17:59 hello.txt
drwxr-xr-x 2 root root 4096 Jun 3 18:04 test
-rw-r--r-- 1 root root 0 Jun 3 18:05 dev.txt
drwxr-xr-x 2 root root 4096 Jun 3 18:08 prod
drwxr-xr-x 2 root root 4096 Jun 3 18:08 qa

- ``1s -S ``--> It will list out the objects with respect to thier size in decreasing order.It wont work in sun solaris.
- ``ls -F ``--> It provides more ways to display all the objects ending with /, @, * respectively. / --> directory, @---> link & * --> executable file.
- ``ls -1``--> Display all the objects in a single coloumn.
- ```ls -a ```--> list all including hidden files and directory
- ```ls *.sh``` --> list all the files having .sh extension.

- ```ls -i ``` --> list the files and directories with index numbers inodes
- ``` ls -d */``` --> list only directories.(we can also specify a pattern)

### DATE Commands
- ```date +%d/%m/%Y ```---> 05/06/2023
- ```date +%H:%M:%S ```---> 15(Hour):58(Min):41(Seconds)
- ```date +%B ```---> It will print the month like: June
- ```date +%A ``` ---> Show todays day like Monday
- ```date -d Yesterday ``` --> It will Show yesterday date and time details.
- ```date -d tomorrow ``` ---> It will show Tomorrow date and time details.

### Directoy commands
- ```pwd``` --> print work directory. Gives the present working directory.

Expand Down