NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

mkdir summer winter - napravivme dva foldera winter and summer
sea praime mkdir summer/seeds - vo summer napraivme folder seeds


rmdir and rm both deletes files or directories but rm brishe i ako ne e empty a rmdir samo ako e empty.


Touch - to create empty file.


mv Stuff/STUFF- go renamenavme od so mali u se so caps.


Cp- copy files; cp -r to copy whole folder.


head SongOfMyself.txt - prints the first 10 lines of the file SOM.
but we can say head SongofMyself.txt -n 100 - will provide us with the first 100 lines of the folder.


tail SongOfMyself.txt - prints the last 10 lines of the file SOM.
but we can say tail SongOfMyself.txt -n 100.
- will provide use with the last 100 lines


cat SongOfMyself.txt - prints the contents of that file to my standard output (Kade si home desktop Bla-Bla posle fata saat)
cat will give us the whole file of SOM - the whole song.
- cat gives us the entire file
- cat contents (entire file)
- if we provide cat with more files will give the contents to all of the files
- cat -n SongOfMyself.txt - gi redi so reden broj site stihovi od pesnata

less shows the content stored inside a file.
kako cat ke ja dae cela pesna samo strana po strana i ustvari motash edna strana at a time
- less SongOfMyself.txt
- b gore one page at a time
- end of the file capital G
- lowercase g to the top


echo - prints the output the argument passed to it.
$echo “HII”
print out: HII
echo “FUCKU” > nikola.txt
instead of printing fucku to the terminal it will redirect it to the folder Nikola.txt.
- za da dodademe use neso na Nikola fileot pisuvame echo “FuckU=Mrsh” >> Nikola.txt stavame dve >> vakvi


Wc useful information about a file or input it receives via pipes.
- wc SongOfMyself.txt
output: 1757 15767 87022 SongOfMyself.txt
- 1757 means number of lines
- 15767 means number of words
- 87022 means number of bytes
-l means just lines
-m characters
-c bytes
-w words
wc -l SongOfMyself.txt
1757 SongOfMyself.txt - outcome
- output of one command is input of another command through pipping
ls -l | wc (piping e so prava linija)


cat groceries.txt butcher.txt | wc -l > number.txt
- cat gi combinenuva dvete.txt | znaci piping i wc l da kazhe broj na lines go redirect ova celo u file number.txt so znaci nema da isprinta tuku ke napravi


sort
$sort everything.txt - will alphabetically sort by default.
we can redirect the file as:
$sort everything.txt > sortedEverything
-f means ignore case (upper or lower case because automatically upper case goes first)
to sort numbers, we say $sort -n nums (the file name in this case nums) from smallest to largest and for vice versa we write $sort -nr nums


uniq
to sort lines of text. removes adjacent duplicate values (meaning, one below the other to be the same name/value)
$sort favFlavors.txt | uniq - the result would be all the values sorted alphabetically but each only once because of the | uniq.
$sort favFlavors.txt | uniq - d = only the duplicates will be here.
you can count how many times each line appears with:
$sort favFlavors.txt | uniq -c
5 chocolates
4 cookies and cream - example output; so, chocolate appeared 5 times.


expansions - special characters
$ vrtena -; echo $PATH ke ni go dae cel pat so kako sme upalile bin min Bla-Bla.
$echo * - gives us every path name in this current folder.
* Means every path
$ echo *.txt - gives us every path name that ends with .txt.
? - any single character ???? - any four characters in a row
$ echo *.?? anything that must end with dot and two characters, for example if we put *.??? - it will give us all the files that end at dot three characters for example .txt, .zip....

$ rm *.?? - removes all the files that end with dot and two characters.


curly braces
example $echo {a, b, c}.txt it will create every possible combination but with one letter e.g. a.txt b.txt.
{1...99} - every number from 1 to 99.


diff - if you have files with same information, diff will process the files and will tell you the differences.
$ diff favFlavors.txt favFlavors2.txt - outcome: the difference
$diff mentions what is the difference: 3c3 < strawberry --- > strawberry and cream mean the third item from the first (strawberry) was changed to strawberry and cream.

$diff -y means compare on the screen both files.
$diff -u see what's changed.


find - find files or folders matching a particular search pattern.
find. - all files on my computer.
find. name '7' - file that has the 7 as its name.
find. name '*7*' - every file name that has a seven in it.


grep - search files or combine it with pipes to filter the output of another command. Not in the files but inside of them.
$grep green SongOfMyself.txt
outcome: prints every sentence where green is mentioned in the file.
we can also make grep to give us the line numbers:
$ grep -n green SongOfMyself.txt: gives the line number to all of the parts there is green mentioned.

$grep -nC 2 green SongOfMyself.txt - gives two lines after and two lines before the line that has green mentioned in it.

$grep -r "chicken" hello.txt
all files nested somewhere in my desktop, and all contain chicken.


ps - your computer is running at all times tons of different processes. You can inspect them all using the ps command.
view a list of processes initiated by anyone.
ps axww
ps axww | grep "Visual Studio" - prints out all the matches for the visual studio code processes.


top - used to list the processes running in real time. Used to display dynamic real-time information about running processes in the system. (display and update sorted information)
$ top -o mem will highlight the mem part and it will give us sorted information in order of how much memory.


kill - send a variety of signals to a program.
$kill -l will list the different signals that we can send.
$kill <PID> (process ID) - most common way
term - gentlest way to quit something or stop a process.
$kill -9 1125066 (PID) no feedback given but the 9th line is killed.


nano- text editor. directly type characters into the file without worrying about modes.

$nano SongOfMyself.txt - opens the file with edit mode.
^X exit
^ replace
^T to spell
^O Write out
^W search
$ nano NewFile.txt - makes new file and immediate ability to edit.


who- users logged in to the system.
$ who - list of people logged in what time and what date.


su - switch users
$su (followed by some username) - enter password to enter as the username.
$su - Elvis takes me right into Elvis' home directory.


sudo - used to run a command as root.
You can run commands as root by entering your user's password (not the root user password).
$ sudo -i starts a shell as root.

ls -l see who the owner is.
$sudo nano /etc./hosts
[sudo] password for colt - not the root password but the colt's password.
specific users have specific permissions.


passwd - two situations. first is when you want to change your password.
$passwd
changing password for colt.
Current password: ...
New password: ...

man passwd -e expire.
$passwd elvis (can do as root user) - i can change Elvis' password.


chown - change ownership.
$chown <owner> <file>
$chown colt Music/
I can't make myself the owner of someone's directories.
$sudo chown colt Music/

$chown -R <owner> - to recursively change the ownership.
$chown kitty CatStuff/
$sudo chown -R kitty CatStuff/


chmod - to change the permission of a file or directory.
who? u-user g-group o-others a-all of the above
what? - removes the permission + grants permission. = set a permission and removes others.
which? r- read w- write x- execute permission.

$chmod a+r then the file name
$chmod o+r Permission/
$chmod g-r Permission/

$chmod a+rwx SongOfMyself to all we add all permissions.
$chmod a-rwx to all remove all permissions.
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.