mirror of
https://github.com/donovanglover/nix-config.git
synced 2024-11-22 16:23:57 +01:00
Update pacman and file permissions in commands.md
This commit is contained in:
parent
72d773c182
commit
faae84eb12
@ -40,17 +40,24 @@ Note that for all of the above, `cd` is not required.
|
|||||||
### Other Commands
|
### Other Commands
|
||||||
|
|
||||||
- Print the working directory: `pwd`
|
- Print the working directory: `pwd`
|
||||||
- Make a script executable: `chmod +x <file>`
|
|
||||||
- Termite the processes with a specific word in it: `killall -q <word>`
|
- Termite the processes with a specific word in it: `killall -q <word>`
|
||||||
- Get the current time and settings: `timedatectl`
|
- Get the current time and settings: `timedatectl`
|
||||||
- Show what gets executed when you run a command: `which <command>`
|
- Show what gets executed when you run a command: `which <command>`
|
||||||
- Create a symbolic (soft) link between two files: `ln -s <source> <dest>`
|
- Create a symbolic (soft) link between two files: `ln -s <source> <dest>`
|
||||||
- When a program references `dest`, it will link to and give `source`.
|
- When a program references `dest`, it will link to and give `source`.
|
||||||
- In comparison, a hard link is when you make a copy of the file
|
- In comparison, a hard link is when you make a copy of the file
|
||||||
- Change the permissions of a directory to all users: `chmod -R a+rwX dir/`
|
|
||||||
- Give permissions to the user `hello` and the group `world`: `chown -R hello:world dir/`
|
- Give permissions to the user `hello` and the group `world`: `chown -R hello:world dir/`
|
||||||
- Given text input, return only unique lines (aka no duplicates): `cat <input_file> | uniq`
|
- Given text input, return only unique lines (aka no duplicates): `cat <input_file> | uniq`
|
||||||
|
|
||||||
|
### Changing File Permissions
|
||||||
|
|
||||||
|
- Make a script executable: `chmod +x <file>`
|
||||||
|
- Change the permissions of a directory to all users: `chmod -R a+rwX dir/`
|
||||||
|
- Give anyone and everyone access to a directory: `chmod -R 777 dir/`
|
||||||
|
- Useful for deleting files that the current user can't delete
|
||||||
|
|
||||||
|
Note that you should *never* give a file or directory more permissions than needed. `a+rwX` and `777` should only be used in extreme situations where you have to change permissions before using a file. You should change the permissions back or delete the file when you're done.
|
||||||
|
|
||||||
### Searching Through Files
|
### Searching Through Files
|
||||||
|
|
||||||
- Search all files in a directory (and all subdirectories) for a given string: `grep -inr <search_term>` **OR** `g <search_term>`
|
- Search all files in a directory (and all subdirectories) for a given string: `grep -inr <search_term>` **OR** `g <search_term>`
|
||||||
@ -151,10 +158,13 @@ Use `firejail` to sandbox a program or other piece of software. This ensures tha
|
|||||||
|
|
||||||
### Pacaur
|
### Pacaur
|
||||||
|
|
||||||
- Install packages: `pacaur -S <packages>`
|
Although the examples above use `pacman`, they apply for `pacaur` as well.
|
||||||
- Remove packages (including dependencies no longer needed): `pacaur -Rs <packages>`
|
|
||||||
- Update all packages: `pacaur -Syu`
|
- Install packages: `pacman -S <packages>`
|
||||||
- Search for a specific package: `pacaur -Ss <package>`
|
- Remove packages (including dependencies no longer needed): `pacman -Rs <packages>`
|
||||||
|
- Update all packages: `pacman -Syu`
|
||||||
|
- Search for a specific package: `pacman -Ss <package>`
|
||||||
|
- List all self-installed packages (i.e. from the AUR): `pacman -Qm`
|
||||||
|
|
||||||
Note that if you ever get 404s with `pacman` or `pacaur`, you need to update your local database to the new download locations with `-Syu` first.
|
Note that if you ever get 404s with `pacman` or `pacaur`, you need to update your local database to the new download locations with `-Syu` first.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user