Skip to content

Commit

Permalink
"final-tut-content"
Browse files Browse the repository at this point in the history
  • Loading branch information
anchalkejriwal committed May 9, 2021
1 parent b0f6eba commit 1ad80ac
Show file tree
Hide file tree
Showing 20 changed files with 175 additions and 0 deletions.
Empty file.
Empty file.
Empty file.
14 changes: 14 additions & 0 deletions tutorial/tutorial_cmd/basiccmdlist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
cd
to go to different directory
ls
to list directory contents
man
display manual pages
mv
Move or rename files and directories
mkdir
Creates a directory
rmdir
Removes a directory
touch
Change a file access and modification times
9 changes: 9 additions & 0 deletions tutorial/tutorial_cmd/cat.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
cat {{file}}
Print the contents of a file to the standard output
cat {{file1}} {{file2}} > {{target_file}}
Concatenate several files into the target file
cat {{file1}} {{file2}} >> {{target_file}}
Append several files into the target file
cat -n {{file}}
Number all output lines:

8 changes: 8 additions & 0 deletions tutorial/tutorial_cmd/cd.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
cd path/to/directory
command to Go to the given directory
cd
command to go to home directory of current user
cd ..
Go up to the parent of the current directory
cd -
Go to the previously chosen directory
15 changes: 15 additions & 0 deletions tutorial/tutorial_cmd/chmod.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
chmod u+x {{file}}
Give the [u]ser who owns a file the right to e[x]ecute it
chmod u+rw {{file_or_directory}}
Give the [u]ser rights to [r]ead and [w]rite to a file/directory
chmod g-x {{file}}
Remove e[x]ecutable rights from the [g]roup
chmod a+rx {{file}}
Give [a]ll users rights to [r]ead and e[x]ecute
chmod o=g {{file}}
give [o]thers (not in the file owner's group) the same rights as the [g]roup
chmod o= {{file}}
Remove all rights from [o]thers
chmod -R g+w,o+w {{directory}}
Change permissions recursively giving [g]roup and [o]thers the ability to [w]rite

11 changes: 11 additions & 0 deletions tutorial/tutorial_cmd/echo.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
echo "{{Hello World}}"
Print a text message. Note: quotes are optional
echo "{{My path is $PATH}}"
Print a message with environment variables
echo -n "{{Hello World}}"
Print a message without the trailing newline
echo "{{Hello World}}" >> {{file.txt}}
Append a message to the file
echo -e "{{Column 1\tColumn 2}}"
Enable interpretation of backslash escapes (special characters):

43 changes: 43 additions & 0 deletions tutorial/tutorial_cmd/git.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
git config –global user.name “[name]”
sets the author name to be used with your commits
git config –global user.email “[email address]”
sets the email address to be used with your commits
git init [repository name]
to start a new repository
git clone [url]
to obtain a repository from an existing URL
git add [file]
adds a file to the staging area
git add *
adds one or more to the staging area.
git commit -m “[ Type in the commit message]”
records or snapshots the file permanently in the version history
git commit -a
commits any files you’ve added with the git add command and also commits any files you’ve changed since then
git diff –staged
shows the differences between the files in the staging area and the latest version present
git reset [file]
command unstages the file, but it preserves the file contents
git reset [commit]
command undoes all the commits after the specified commit and preserves the changes locally
git status
command lists all the files that have to be committed.
git log
command is used to list the version history for the current branch.
git branch
lists all the local branches in the current repository
git checkout [branch name]
command is used to switch from one branch to another
git merge [branch name]
merges the specified branch’s history into the current branch.
git remote add [variable name] [Remote Server Link]
command is used to connect your local repository to the remote server
git push [variable name] master
sends the committed changes of master branch to your remote repository
git push [variable name] [branch]
command sends the branch commits to your remote repository
git push –all [variable name]
command pushes all branches to your remote repository
git pull [Repository Link]
command fetches and merges changes on the remote server to your working directory

5 changes: 5 additions & 0 deletions tutorial/tutorial_cmd/grep.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
grep "{{search_pattern}}" {{path/to/file}}
Search for a pattern within a file
grep --fixed-strings "{{exact_string}}" {{path/to/file}}
Search for an exact string (disables regular expressions)

14 changes: 14 additions & 0 deletions tutorial/tutorial_cmd/intermediatecmdlist
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Cat
Print and concatenate files
echo
Print given arguments
chmod
Change the access permissions of a file or directory
grep
Find patterns in files using regular expressions
sort
Sort lines of text files
hostnamectl
to find hostname
git
used while working with git
14 changes: 14 additions & 0 deletions tutorial/tutorial_cmd/intermediatecmdlist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Cat
Print and concatenate files
echo
Print given arguments
chmod
Change the access permissions of a file or directory
grep
Find patterns in files using regular expressions
sort
Sort lines of text files
hostnamectl
to find hostname
git
used while working with git
10 changes: 10 additions & 0 deletions tutorial/tutorial_cmd/ls.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
ls
ls command is used to list directory contents
ls -1
List files one per line
ls -a
List all files, including hidden files
ls -F
List all files, with trailing / added to directory names
ls -la
Long format list (permissions, ownership, size, and modification date) of all files
2 changes: 2 additions & 0 deletions tutorial/tutorial_cmd/man.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
man {command}
Display the man page for a command
2 changes: 2 additions & 0 deletions tutorial/tutorial_cmd/mkdir.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mkdir {{directory}}
Create a directory in current directory or given path
6 changes: 6 additions & 0 deletions tutorial/tutorial_cmd/mv.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
mv {{source}} {{target}}
Move files in arbitrary locations
mv -f {{source}} {{target}}
Do not prompt for confirmation before overwriting existing files
mv -i {{source}} {{target}}
Prompt for confirmation before overwriting existing files, regardless of file permissions
2 changes: 2 additions & 0 deletions tutorial/tutorial_cmd/pipe and redirections.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
command_1 | command_2 | command_3 | .... | command_N
to pass output of one command acts as input to another command
4 changes: 4 additions & 0 deletions tutorial/tutorial_cmd/rmdir.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
rmdir {{path/to/directory}}
to remove directory *use rm-r to remove empty directory*
rmdir -p {{path/to/directory}}
Remove the target and its parent directories (useful for nested dirs)
9 changes: 9 additions & 0 deletions tutorial/tutorial_cmd/sort.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
sort {{path/to/file}}
Sort a file in ascending order
sort --reverse {{path/to/file}}
Sort a file in descending order
sort --ignore-case {{path/to/file}}
Sort a file in case-insensitive way
sort --numeric-sort {{path/to/file}}
Sort a file using numeric rather than alphabetic order

7 changes: 7 additions & 0 deletions tutorial/tutorial_cmd/touch.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
touch {{filename}}
Create a new empty file(s) or change the times for existing file(s) to current time
touch -t {{YYYYMMDDHHMM.SS}} {{filename}}
Set the times on a file to a specific date and time
touch -r {{filename}} {{filename2}}
Use the times from a file to set the times on a second file

0 comments on commit 1ad80ac

Please sign in to comment.