weednix / from_dead_zero

How do we mentor a gifted student who is starting from dead zero?
0 stars 0 forks source link

Learn basic Unix command line usage. #2

Open ashleygould opened 4 years ago

ashleygould commented 4 years ago

https://ubuntu.com/tutorials/command-line-for-beginners#1-overview

ashleygould commented 4 years ago

Keep a list of all shell commands you use and add it to this repository. This will grow as time goes by. Push this file to root of repository as sophias_commands_file

SRSGitHub commented 4 years ago

I have copy and pasted my progress on the command line for your review. I hope you can make since out of what I have here.


sophiarice-smith@mango:~$ pwd /home/sophiarice-smith sophiarice-smith@mango:~$ cd / sophiarice-smith@mango:/$ pwd / sophiarice-smith@mango:/$ cd home sophiarice-smith@mango:/home$ pwd /home sophiarice-smith@mango:/home$ cd .. sophiarice-smith@mango:/$ pwd / sophiarice-smith@mango:/$ cd sophiarice-smith@mango:~$ pwd /home/sophiarice-smith sophiarice-smith@mango:~$ cd ../.. sophiarice-smith@mango:/$ pwd / sophiarice-smith@mango:/$ cd sophiarice-smith@mango:~$ pwd /home/sophiarice-smith sophiarice-smith@mango:~$ cd ../../etc sophiarice-smith@mango:/etc$ pwd /etc sophiarice-smith@mango:/etc$ cd / sophiarice-smith@mango:/$ pwd / sophiarice-smith@mango:/$ cd etc sophiarice-smith@mango:/etc$ pwd /etc sophiarice-smith@mango:/etc$ cd sophiarice-smith@mango:~$ pwd /home/sophiarice-smith sophiarice-smith@mango:~$ cd etc bash: cd: etc: No such file or directory sophiarice-smith@mango:~$ pwd /home/sophiarice-smith sophiarice-smith@mango:~$ cd sophiarice-smith@mango:~$ whoami sophiarice-smith sophiarice-smith@mango:~$ cd /home/USERNAME/Desktop bash: cd: /home/USERNAME/Desktop: No such file or directory sophiarice-smith@mango:~$ pwd /home/sophiarice-smith sophiarice-smith@mango:~$ cd ~ sophiarice-smith@mango:~$ pwd /home/sophiarice-smith sophiarice-smith@mango:~$ cd ~/Desktop sophiarice-smith@mango:~/Desktop$ pwd /home/sophiarice-smith/Desktop sophiarice-smith@mango:~/Desktop$ cd sophiarice-smith@mango:~$ cd / sophiarice-smith@mango:/$ cd ~/Desktop sophiarice-smith@mango:~/Desktop$ cd /etc sophiarice-smith@mango:/etc$ cd /var/log sophiarice-smith@mango:/var/log$ cd .. sophiarice-smith@mango:/var$ cd sophiarice-smith@mango:~$ mkdr/ tmp/tutorial bash: mkdr/: No such file or directory sophiarice-smith@mango:~$ mkdir/ tmp/tutorial bash: mkdir/: No such file or directory sophiarice-smith@mango:~$ mkdir /tmp/tutorial sophiarice-smith@mango:~$ cd /tmp/tutorial sophiarice-smith@mango:/tmp/tutorial$ mkdir dir1 dir2 dir3 sophiarice-smith@mango:/tmp/tutorial$ mkdir mkdir: missing operand Try 'mkdir --help' for more information. sophiarice-smith@mango:/tmp/tutorial$ cd /etc ~/Desktop bash: cd: too many arguments sophiarice-smith@mango:/tmp/tutorial$ ls dir1 dir2 dir3 sophiarice-smith@mango:/tmp/tutorial$ mkdir -p dir4/dir5/dir6 sophiarice-smith@mango:/tmp/tutorial$ ls dir1 dir2 dir3 dir4 sophiarice-smith@mango:/tmp/tutorial$ cd dir4 sophiarice-smith@mango:/tmp/tutorial/dir4$ ls dir5 sophiarice-smith@mango:/tmp/tutorial/dir4$ cd dir5 sophiarice-smith@mango:/tmp/tutorial/dir4/dir5$ ls dir6 sophiarice-smith@mango:/tmp/tutorial/dir4/dir5$ cd ../.. sophiarice-smith@mango:/tmp/tutorial$ mkdir another folder sophiarice-smith@mango:/tmp/tutorial$ ls another dir1 dir2 dir3 dir4 folder sophiarice-smith@mango:/tmp/tutorial$ mkdir "folder 1" sophiarice-smith@mango:/tmp/tutorial$ mkdir 'folder 2' sophiarice-smith@mango:/tmp/tutorial$ mkdir folder\ 3 sophiarice-smith@mango:/tmp/tutorial$ mkdir "folder 4" "folder 5" sophiarice-smith@mango:/tmp/tutorial$ mkdir -p "folder 6"/"folder 7" sophiarice-smith@mango:/tmp/tutorial$ ls another dir2 dir4 'folder 1' 'folder 3' 'folder 5' dir1 dir3 folder 'folder 2' 'folder 4' 'folder 6' sophiarice-smith@mango:/tmp/tutorial$ ls another dir2 dir4 'folder 1' 'folder 3' 'folder 5' dir1 dir3 folder 'folder 2' 'folder 4' 'folder 6' sophiarice-smith@mango:/tmp/tutorial$ ls > output.txt sophiarice-smith@mango:/tmp/tutorial$ cat output.txt another dir1 dir2 dir3 dir4 folder folder 1 folder 2 folder 3 folder 4 folder 5 folder 6 output.txt sophiarice-smith@mango:/tmp/tutorial$ echo "This is a test" This is a test sophiarice-smith@mango:/tmp/tutorial$ echo "This is a test" > test_1.txt sophiarice-smith@mango:/tmp/tutorial$ echo "This is a second test" > test_2.txt sophiarice-smith@mango:/tmp/tutorial$ echo "This is a third test" > test_3.txt sophiarice-smith@mango:/tmp/tutorial$ ls another dir3 'folder 1' 'folder 4' output.txt test_3.txt dir1 dir4 'folder 2' 'folder 5' test_1.txt dir2 folder 'folder 3' 'folder 6' test_2.txt sophiarice-smith@mango:/tmp/tutorial$ cat test_1.txt test_2.txt test_3.txt This is a test This is a second test This is a third test sophiarice-smith@mango:/tmp/tutorial$ cat test_1.txt test_2.txt test3.txt This is a test This is a second test This is a third test sophiarice-smith@mango:/tmp/tutorial$ cat test?.txt This is a test This is a second test This is a third test sophiarice-smith@mango:/tmp/tutorial$ cat test_ This is a test This is a second test This is a third test sophiarice-smith@mango:/tmp/tutorial$ mv combined.txt dir1 mv: cannot stat 'combined.txt': No such file or directory sophiarice-smith@mango:/tmp/tutorial$ cat t > combined.txt sophiarice-smith@mango:/tmp/tutorial$ cat combined.txt This is a test This is a second test This is a third test sophiarice-smith@mango:/tmp/tutorial$ cat t >> combined.txt sophiarice-smith@mango:/tmp/tutorial$ echo "I've appended a line!" >> combined.txt sophiarice-smith@mango:/tmp/tutorial$ cat combined.txt This is a test This is a second test This is a third test This is a test This is a second test This is a third test I've appended a line! sophiarice-smith@mango:/tmp/tutorial$ less combined.txt sophiarice-smith@mango:/tmp/tutorial$ echo "Lower case" > a.txt sophiarice-smith@mango:/tmp/tutorial$ echo "Upper case" > A.TXT sophiarice-smith@mango:/tmp/tutorial$ echo "Mixed case" > A.txt sophiarice-smith@mango:/tmp/tutorial$ mv combined.txt dir1 sophiarice-smith@mango:/tmp/tutorial$ ls another A.TXT dir3 'folder 1' 'folder 4' output.txt test_3.txt a.txt dir1 dir4 'folder 2' 'folder 5' test_1.txt A.txt dir2 folder 'folder 3' 'folder 6' test_2.txt sophiarice-smith@mango:/tmp/tutorial$ ls dir1 combined.txt sophiarice-smith@mango:/tmp/tutorial$ mv dir1/ . sophiarice-smith@mango:/tmp/tutorial$ mv combined.txt test_ dir3 dir2 sophiarice-smith@mango:/tmp/tutorial$ ls another A.TXT dir4 'folder 2' 'folder 5' a.txt dir1 folder 'folder 3' 'folder 6' A.txt dir2 'folder 1' 'folder 4' output.txt sophiarice-smith@mango:/tmp/tutorial$ ls dir2 combined.txt dir3 test_1.txt test_2.txt test_3.txt sophiarice-smith@mango:/tmp/tutorial$ mv dir2/combined.txt dir4/dir5/dir6 sophiarice-smith@mango:/tmp/tutorial$ ls another A.TXT dir4 'folder 2' 'folder 5' a.txt dir1 folder 'folder 3' 'folder 6' A.txt dir2 'folder 1' 'folder 4' output.txt sophiarice-smith@mango:/tmp/tutorial$ ls dir2 dir3 test_1.txt test_2.txt test_3.txt sophiarice-smith@mango:/tmp/tutorial$ ls dir4/dir5/dir6 combined.txt sophiarice-smith@mango:/tmp/tutorial$ cp dir4/dir5/dir6/combined.txt . sophiarice-smith@mango:/tmp/tutorial$ ls dir4/dir5/dir6 combined.txt sophiarice-smith@mango:/tmp/tutorial$ ls another A.TXT dir2 'folder 1' 'folder 4' output.txt a.txt combined.txt dir4 'folder 2' 'folder 5' A.txt dir1 folder 'folder 3' 'folder 6' sophiarice-smith@mango:/tmp/tutorial$ cp combined.txt backup_combined.txt sophiarice-smith@mango:/tmp/tutorial$ ls another A.TXT dir1 folder 'folder 3' 'folder 6' a.txt backup_combined.txt dir2 'folder 1' 'folder 4' output.txt A.txt combined.txt dir4 'folder 2' 'folder 5' sophiarice-smith@mango:/tmp/tutorial$ mv backup_combined.txt combined_backup.txtsophiarice-smith@mango:/tmp/tutorial$ ls another A.TXT dir1 folder 'folder 3' 'folder 6' a.txt combined_backup.txt dir2 'folder 1' 'folder 4' output.txt A.txt combined.txt dir4 'folder 2' 'folder 5' sophiarice-smith@mango:/tmp/tutorial$ mv "folder 1" folder_1 sophiarice-smith@mango:/tmp/tutorial$ mv "folder 2" folder_2 sophiarice-smith@mango:/tmp/tutorial$ mv "folder 3" folder_3 sophiarice-smith@mango:/tmp/tutorial$ mv "folder 4" folder_4 sophiarice-smith@mango:/tmp/tutorial$ mv "folder 5" folder_5 sophiarice-smith@mango:/tmp/tutorial$ mv "folder 6" folder_6 sophiarice-smith@mango:/tmp/tutorial$ ls another A.TXT dir1 folder folder_3 folder_6 a.txt combined_backup.txt dir2 folder_1 folder_4 output.txt A.txt combined.txt dir4 folder_2 folder_5 sophiarice-smith@mango:/tmp/tutorial$ rm dir4/dir5/dir6/combined.txt combinedbackup.txt sophiarice-smith@mango:/tmp/tutorial$ rm folder rm: cannot remove 'folder_1': Is a directory rm: cannot remove 'folder_2': Is a directory rm: cannot remove 'folder_3': Is a directory rm: cannot remove 'folder_4': Is a directory rm: cannot remove 'folder_5': Is a directory rm: cannot remove 'folder6': Is a directory sophiarice-smith@mango:/tmp/tutorial$ rmdir folder* rmdir: failed to remove 'folder_6': Directory not empty sophiarice-smith@mango:/tmp/tutorial$ rm -r folder_6 sophiarice-smith@mango:/tmp/tutorial$ ls another A.txt combined.txt dir2 folder a.txt A.TXT dir1 dir4 output.txt sophiarice-smith@mango:/tmp/tutorial$ wc -l combined.txt 7 combined.txt sophiarice-smith@mango:/tmp/tutorial$ ls ~ > file_list.txt sophiarice-smith@mango:/tmp/tutorial$ wc -l file_list.txt 46 file_list.txt sophiarice-smith@mango:/tmp/tutorial$ rm file_list.txt sophiarice-smith@mango:/tmp/tutorial$ ls ~ | wc -l 46 sophiarice-smith@mango:/tmp/tutorial$ ls /etc|wc-l wc-l: command not found sophiarice-smith@mango:/tmp/tutorial$ ls /etc|wc -l 228 sophiarice-smith@mango:/tmp/tutorial$ ls /etc | less sophiarice-smith@mango:/tmp/tutorial$ sophiarice-smith@mango:/tmp/tutorial$ cat combined.txt | uniq | wc -l 7 sophiarice-smith@mango:/tmp/tutorial$ cat combined.txt | uniq | less sophiarice-smith@mango:/tmp/tutorial$ man uniq sophiarice-smith@mango:/tmp/tutorial$ sort combined.txt | less sophiarice-smith@mango:/tmp/tutorial$ sort combined.txt | uniq | wc -l 4

sophiarice-smith@mango:/tmp/tutorial$ sudo cat /etc/shadow

sync::17737:0:99999:7::: games::17737:0:99999:7::: man::17737:0:99999:7::: lp::17737:0:99999:7::: mail::17737:0:99999:7::: news::17737:0:99999:7::: uucp::17737:0:99999:7::: proxy::17737:0:99999:7::: www-data::17737:0:99999:7::: backup::17737:0:99999:7::: list::17737:0:99999:7::: irc::17737:0:99999:7::: gnats::17737:0:99999:7::: nobody::17737:0:99999:7::: systemd-network::17737:0:99999:7::: systemd-resolve::17737:0:99999:7::: syslog::17737:0:99999:7::: messagebus::17737:0:99999:7::: _apt::17737:0:99999:7::: uuidd::17737:0:99999:7::: avahi-autoipd::17737:0:99999:7::: usbmux::17737:0:99999:7::: dnsmasq::17737:0:99999:7::: rtkit::17737:0:99999:7::: cups-pk-helper::17737:0:99999:7::: speech-dispatcher:!:17737:0:99999:7::: whoopsie::17737:0:99999:7::: kernoops::17737:0:99999:7::: saned::17737:0:99999:7::: pulse::17737:0:99999:7::: avahi::17737:0:99999:7::: colord::17737:0:99999:7::: hplip::17737:0:99999:7::: geoclue::17737:0:99999:7::: gnome-initial-setup::17737:0:99999:7::: gdm:*:17737:0:99999:7:::

sophiarice-smith@mango:/tmp/tutorial$ sudo apt install tree [sudo] password for sophiarice-smith: Reading package lists... Done Building dependency tree
Reading state information... Done The following NEW packages will be installed: tree 0 upgraded, 1 newly installed, 0 to remove and 240 not upgraded. Need to get 40.7 kB of archives. After this operation, 105 kB of additional disk space will be used. Get:1 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 tree amd64 1.7.0-5 [40.7 kB] Fetched 40.7 kB in 1s (33.9 kB/s) Selecting previously unselected package tree. (Reading database ... 230191 files and directories currently installed.) Preparing to unpack .../tree_1.7.0-5_amd64.deb ... Unpacking tree (1.7.0-5) ... Setting up tree (1.7.0-5) ... Processing triggers for man-db (2.8.3-2ubuntu0.1) ... sophiarice-smith@mango:/tmp/tutorial$ cd /tmp/tutorial sophiarice-smith@mango:/tmp/tutorial$ tree . ├── another ├── a.txt ├── A.txt ├── A.TXT ├── combined.txt ├── dir1 ├── dir2 │   ├── dir3 │   ├── test_1.txt │   ├── test_2.txt │   └── test_3.txt ├── dir4 │   └── dir5 │   └── dir6 ├── folder └── output.txt

8 directories, 8 files sophiarice-smith@mango:/tmp/tutorial$ cd /tmp/tutorial sophiarice-smith@mango:/tmp/tutorial$ ls another A.txt combined.txt dir2 folder a.txt A.TXT dir1 dir4 output.txt sophiarice-smith@mango:/tmp/tutorial$ mv combined.txt .combined.txt sophiarice-smith@mango:/tmp/tutorial$ ls another a.txt A.txt A.TXT dir1 dir2 dir4 folder output.txt sophiarice-smith@mango:/tmp/tutorial$ cat .combined.txt This is a test This is a second test This is a third test This is a test This is a second test This is a third test I've appended a line! sophiarice-smith@mango:/tmp/tutorial$ mkdir .hidden sophiarice-smith@mango:/tmp/tutorial$ mv .combined.txt .hidden sophiarice-smith@mango:/tmp/tutorial$ less .hidden/.combined.txt sophiarice-smith@mango:/tmp/tutorial$ ls another a.txt A.txt A.TXT dir1 dir2 dir4 folder output.txt sophiarice-smith@mango:/tmp/tutorial$ ls -a . another A.txt dir1 dir4 .hidden .. a.txt A.TXT dir2 folder output.txt sophiarice-smith@mango:/tmp/tutorial$ ls .hidden sophiarice-smith@mango:/tmp/tutorial$ ls -a .hidden . .. .combined.txt sophiarice-smith@mango:/tmp/tutorial$ tree . ├── another ├── a.txt ├── A.txt ├── A.TXT ├── dir1 ├── dir2 │   ├── dir3 │   ├── test_1.txt │   ├── test_2.txt │   └── test_3.txt ├── dir4 │   └── dir5 │   └── dir6 ├── folder └── output.txt

8 directories, 7 files sophiarice-smith@mango:/tmp/tutorial$ tree -a . ├── another ├── a.txt ├── A.txt ├── A.TXT ├── dir1 ├── dir2 │   ├── dir3 │   ├── test_1.txt │   ├── test_2.txt │   └── test_3.txt ├── dir4 │   └── dir5 │   └── dir6 ├── folder ├── .hidden │   └── .combined.txt └── output.txt

9 directories, 8 files sophiarice-smith@mango:/tmp/tutorial$ cd sophiarice-smith@mango:~$ ls 1.1-boxmodel dir4 Pictures 1.2-css Documents pipenv 1.3-bootstrap Downloads 'PM Slack.odp' 2.1-bash examples.desktop Public 5.2-servers filenames.txt python 5.3-heroku git-repos rep0 6.1-django green_dust_scratch rep1 6.2-forms hello-world.html rep2 6.3-users 'Hello World.py' Repository 7.3-sorting heroku_pg_demo snap 8.2-joins Hwk1.html Templates 'Demo1- for loops' kittyadopt TEST 'Demo2-More for loops' mozilla.pdf User_class.py Desktop Music Videos dir1 my_testing_git_repo dir2 output.txt sophiarice-smith@mango:~$ ls -a . Downloads pipenv .. examples.desktop .pki 1.1-boxmodel filenames.txt 'PM Slack.odp' 1.2-css .gconf .profile 1.3-bootstrap .gitconfig .psql_history 2.1-bash git-repos Public 5.2-servers .gnome python 5.3-heroku .gnupg .python_history 6.1-django green_dust_scratch rep0 6.2-forms hello-world.html rep1 6.3-users 'Hello World.py' rep2 7.3-sorting heroku_pg_demo Repository 8.2-joins Hwk1.html snap .bash_history .ICEauthority .ssh .bash_logout kittyadopt .sudo_as_admin_successful .bashrc .lesshst Templates .cache .local TEST .config .mongorc.js .thunderbird .cxoffice .mozilla User_class.py 'Demo1- for loops' mozilla.pdf Videos 'Demo2-More for loops' Music .viminfo Desktop my_testing_git_repo .vimrc dir1 .netrc .vscode dir2 .npm .zoom dir4 output.txt Documents Pictures sophiarice-smith@mango:~$ wc -l

ashleygould commented 4 years ago

remove contents from /etc/shadow.