Created
June 30, 2021 15:05
-
-
Save ab007shetty/3204d198a92104c181ee6f5e2cc16f0f to your computer and use it in GitHub Desktop.
Important Bash Commands Used in Google IT Support Specialization
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Week 1: | |
1. ls / or ls /home -list all | |
2. ls --help -help menu | |
3. man ls -more than help | |
4. ls / -l -properties with longlist | |
5. ls / -l -a -hiddden files | |
5. pwd -print working directory | |
6. cd /home/ABShetty -change directory | |
7. cd .. - moves one lvl up | |
8. cd ~ - opens default user space | |
9. mkdir folder_name - make folder(space not allowed) | |
10. mkdir 'folder name' or | |
mkdir my`\ folder\ name -(back slash \) | |
11. history or ctrl+ r or arrow keys -recent commands list | |
12. cp *.jpeg /home/ABShetty -wildcard selection | |
cp -r 'folder-name' path | |
13. mv file_name new_filename -rename | |
mv filename path -move( use wildcard) | |
14. rm -r foldername -delete recursively | |
15. cat /filename -opens entire file_name | |
16. less /filename -just 1 page,with more option below | |
g (moves to beginning) | |
G (end) | |
arrow keys and page up and down | |
/word_u_want_to_search -searches word in that opened txt file | |
q (quit) | |
17. head /filename -1st 10 lines | |
tail /filename -last 10 lines by default | |
18. nano filename -lightweight editor | |
19. grep search_word file_name -searches for word | |
20. echo some_words > filename -creates file & writes | |
(echo boli > dog.txt) | |
(echo maga >> dog.txt) - (>> append) not overwrite,it updats | |
21. ls /dir/fake_dir 2 > error.txt -redirects error to file | |
(dev/null unexited folder,used to filter error) | |
22. command | another_command -concatinates commands | |
------------------------------------------------------------------------------------- | |
week 2: | |
1. sudo cat /etc/sudoers -to access restricted files | |
2. su user_name -substitute user, defaults to root user. | |
3. cat /etc/group -show groups. | |
4. cat /etc/passwd -shows users | |
5. passwd user_name -changes psswd | |
6. sudo psswd -e user_name - (e expire flag)force passwd change. | |
7. sudo useradd user_name -add user | |
8. sudo userdel user_name -delete user | |
9. chmod ugo+rwx filename - permission setting( symbolic format) | |
( u-user g-group o-others | |
r-read w-write x-execute) | |
10. chmod 754 filename -using octals: | |
( 7 -> 111 , order-rwx , 1=true 0-false -user has all permissions | |
5 -> 101 , - group has only read and execute | |
4 -> 100 , - others had only read. | |
11. sudo chown owner_name filename - change owner of file | |
12. sudo chgrp group_name file_name -changing group owner for the file | |
------------------------------------------------------------------------------------------------------------- | |
1. sudo dpkg -i atom-amd64deb -debian pkg manager, i for install | |
2. sudo dpkg -r atom -removes pkg | |
3. uname -r - | |
4. sudo apt full-upgrade -including dependencies for all pckages | |
5. apt update & apt upgrade -for single pkg | |
6. Diskpart -tool for partition | |
7. list disk -lists all partitions | |
select disk 1 - selects 1st one | |
clean | |
create partition primary -creates another partition | |
select partition 1 | |
active -make is as active to use | |
format FS=NTFS label=my-drive quick - formates file system NTFS with quick flash | |
8. sudo parted -l - lists disks | |
sudo parted /dev/sdb -starts using /dev/sdb | |
mklabel gpt | |
mkpart primary ext4 1MiB 5GiB -creating partition with ext4 | |
quit | |
sudo mkfs -t ext4 /dev/sdb1 -changes to ext4 | |
sudo mount /dev/sdb1 /my_usb/ -make it to use | |
sudo unmount /dev/sdb1 -unmount | |
sudo blkid - shows UUID for block device IDs | |
sudo mkswap /dev/sdb2 -swapping | |
sudo swapon /dev/sdb2 - command to swapon | |
9. ln -s file_name softink_filename -creating softlink for file | |
10. notepad.exe file_1_shortcut.lnk -creating shortcut | |
mklink file_1_symlink file_1.txt -making symbolic link | |
notepad.exe file_1_symlink | |
mklink /H file_1_hardlink file_1.txt -making hardlink | |
11. fsutil query c: - self healing disks | |
12. chkdsk /F D: - checking thumbdrive | |
13. sudo fsck /dev/sda - file system chek, but harmfull | |
14. ps -x - prints all processes | |
15. ps -ef - prints process with more fields | |
ps -ef | grep chrome - searches for particulat one | |
16. ls -l /proc - shows process with permissions etc/group | |
17. kill -KILL 10392 -kills process with id (absolutely kill) | |
18. uptime - shows load avg | |
19. lsof -lists open files and what process are using them | |
20. scp file_with_path username@ip_address -share file remotely over scp protocol | |
21. ls /var/log - prints log page | |
22. less /var/log/syslog | grep error -particularly accesssing syslog to search error | |
23. tail -f /var/log/syslog -end part of syslog,new things are updated here | |
24. sudo dd if=/dev/sdd of=/desktop/my_usb_image.img bs=100M - imaging usb drive to desktop as my_usb_image.img |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment