mattersnsa.blogg.se

Bash commands mac cheat sheet
Bash commands mac cheat sheet




bash commands mac cheat sheet bash commands mac cheat sheet

Gives a one-line description of ‘command’ Push output to file, keep in mind it will get overwritten Output content delivered in screensize chunks PIPES – Allows to combine multiple commands that generate output more Remove directory ( only operates on empty directories ) Interactively search through previously typed commandsĮxecute the last command typed that starts with ‘value’ Shows the stuff typed – add a number to limit the last n items Run command with the security privileges of the superuser (Super User DO)ĭisplays active processes. Long listing with Human readable file sizes

bash commands mac cheat sheet

Lets you search through previously used commands Swap the last two words before the cursor Swap the last two characters before the cursor Go to the end of the line you are currently typing on Ufw allow proto tcp from 192.1.1.Go to the beginning of the line you are currently typing on Journalctl -since "YYYY-MM-DD HH:MM:SS" journalctl -since yesterday journalctl -since HH:MM -until "X hours ago" Edit /etc/systemd/nf and under set storage=persistent to keep logs across boots. Sudo journalctl, -b for current boot messages, -k for kernel messages. Sudo systemctl edit & sudo systemctl daemon-reload Sudo systemctl is-active|is-enabled|is-failed Systemctl list-units systemctl list-unit-files

bash commands mac cheat sheet

Sudo chown -R the_new_guy:the_new_guy /home/vivek/.ssh/ ' > /home/the_new_guy/.ssh/authorized_keys" # key onto the server's authorized-keys file for the user. # Must have a private/public keypair on your local machine and copy the public Sudo adduser the_new_guy new_guys_password The -c option produces a grand total.Ĭhmod + file or chmod -R + dirĬhange the owner/group/all permissions assigned to a resource: Sudo mkdir my-mount-directory sudo mount /dev/sdb1 my-mount-directoryĭu -sh dir. Get the nth argument of the previous command If found, display and execute commandĬhange the first occurence of str1 in previous command to str2Ĭhange ALL occurences of str1 in previous command to str2 Search backwards through command history for first command that contains with "word". Search backwards through command history for first command that starts with "word". $ # Set entire string to uppercaseĭisplay and execute the fourth commnd in the history tableĭisplay and execute command 2 commands back $*, arguments on the command line from $1 onwards. Process number of last background command Afterwards, expands to last argument to the previous command, after expansion Free-electrons provide this rather useful cheet sheet.Īt shell startup contains absolute filename of shell or script.






Bash commands mac cheat sheet