Skip to content
Open
Show file tree
Hide file tree
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: 34 additions & 2 deletions Linux-Commands/.ipynb_checkpoints/Linux-Commands-checkpoint.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,27 @@
" |```sudo getent group sudo```| list of accounts that belong to the sudo Permissions| \n",
" |```sudo passwd <user_name>```| Change userpassword | \n",
" |```su - [user_name]``` OR ```sudo -i [user_name]```| change user | \n",
" \n",
" |` sudo useradd [USERNAME]`| add a new user with [USERNAME] | \n",
" |` sudo useradd -m [USERNAME]`| add a new User with [USERNAME] AND a home directory| \n",
" |` sudo useradd -r [USERNAME]`| add a new SYSTEM User with [USERNAME] (this type of user has ID under 1000 ** | \n",
" |`cat /etc/passwd`|list of all users (actual users) such as admin and SYSTEM Users *** | \n",
" |`users`| list of all users currently logged in according to FILE. | \n",
" |`ls -l /home`| print currently logged in users' home directories | \n",
" |`sudo userdel [USERNAME]`| deletes the user [USERNAME] | \n",
" |`sudo userdel -f [USERNAME]`| deletes the user [USERNAME] AND their home directory | \n",
" |` `| | \n",
" |` `| | \n",
" \n",
"\n",
"** System Users: are going to run in the background, schedule tasks processes etc.\n",
"\n",
"*** 1st column username, 2nd column refers to the hashed password which is in the `/etc/shadow` file (hashed password is not the actual password it the hashed version), 3rd column Uid (User ID) if under 1000 it's system user, else actual user. 4th column Gid (Group ID), 5th column, GECOS field (user information field, such as first last name and it's optional), 6th column refers to home directory of that user, 7th column shell that designated that user (what shell is activated when that user is logged in for actual users, for system users usually shell is `usr/sbin/nologin` where usually system users are not associated to human being and do not need to login)\n",
"\n",
"**References**: \n",
"- [Linux Crash Course - Managing Users](https://www.youtube.com/watch?v=19WOD84JFxA)\n",
"- [Text](https:///.com)\n",
"\n",
"\n",
"### File & Folder Management\n",
"\n",
" | Command | Description|\n",
Expand Down Expand Up @@ -125,7 +145,18 @@
" |```awk '{print $N}' [file_name]```| print the Nth column of a file_name| \n",
" |```grep [search_keyword] [file_name]```| search and prints the lines of a search_keyword in a file_name| \n",
" |```sort [file_name]```| sorts a file_name alphabetically| \n",
" |```uniq ```| |\n"
" |```uniq [file_name]```| removes all the duplicate lines from a file_name|\n",
" |```wc [file_name]```| counts the words of a file_name|\n",
" \n",
"### Compare Files\n",
"\n",
" | Command | Description|\n",
" |---|---|\n",
" |```diff [file_name_1] [file_name_2]```|compare two files Line by line | \n",
" |```сmр [file_name_1] [file_name_2]```| compare two files Byte by byte | \n",
" \n",
"• diff (Line by line)\n",
"• стр (Byte by byte)\n"
]
},
{
Expand All @@ -148,6 +179,7 @@
"`su` can also function as `sudo` and run a single command as the root:\n",
"`su -c [command]`\n",
"\n",
"** `sudo` used to run system command with root privileges, which is required for any command that's going to make changes to the system.\n",
"\n",
"\n",
"### References\n",
Expand Down
23 changes: 22 additions & 1 deletion Linux-Commands/Linux-Commands.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,27 @@
" |```sudo getent group sudo```| list of accounts that belong to the sudo Permissions| \n",
" |```sudo passwd <user_name>```| Change userpassword | \n",
" |```su - [user_name]``` OR ```sudo -i [user_name]```| change user | \n",
" \n",
" |` sudo useradd [USERNAME]`| add a new user with [USERNAME] | \n",
" |` sudo useradd -m [USERNAME]`| add a new User with [USERNAME] AND a home directory| \n",
" |` sudo useradd -r [USERNAME]`| add a new SYSTEM User with [USERNAME] (this type of user has ID under 1000 ** | \n",
" |`cat /etc/passwd`|list of all users (actual users) such as admin and SYSTEM Users *** | \n",
" |`users`| list of all users currently logged in according to FILE. | \n",
" |`ls -l /home`| print currently logged in users' home directories | \n",
" |`sudo userdel [USERNAME]`| deletes the user [USERNAME] | \n",
" |`sudo userdel -f [USERNAME]`| deletes the user [USERNAME] AND their home directory | \n",
" |` `| | \n",
" |` `| | \n",
" \n",
"\n",
"** System Users: are going to run in the background, schedule tasks processes etc.\n",
"\n",
"*** 1st column username, 2nd column refers to the hashed password which is in the `/etc/shadow` file (hashed password is not the actual password it the hashed version), 3rd column Uid (User ID) if under 1000 it's system user, else actual user. 4th column Gid (Group ID), 5th column, GECOS field (user information field, such as first last name and it's optional), 6th column refers to home directory of that user, 7th column shell that designated that user (what shell is activated when that user is logged in for actual users, for system users usually shell is `usr/sbin/nologin` where usually system users are not associated to human being and do not need to login)\n",
"\n",
"**References**: \n",
"- [Linux Crash Course - Managing Users](https://www.youtube.com/watch?v=19WOD84JFxA)\n",
"- [Text](https:///.com)\n",
"\n",
"\n",
"### File & Folder Management\n",
"\n",
" | Command | Description|\n",
Expand Down Expand Up @@ -159,6 +179,7 @@
"`su` can also function as `sudo` and run a single command as the root:\n",
"`su -c [command]`\n",
"\n",
"** `sudo` used to run system command with root privileges, which is required for any command that's going to make changes to the system.\n",
"\n",
"\n",
"### References\n",
Expand Down