Skip to content

Instantly share code, notes, and snippets.

@Bigsby
Last active June 22, 2018 13:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Bigsby/a0511c90ab90a7e953d29db3f709889a to your computer and use it in GitHub Desktop.
Save Bigsby/a0511c90ab90a7e953d29db3f709889a to your computer and use it in GitHub Desktop.
Useful *-nix stuff

Aptitude

Search packages

$ apt-cache search «keyword»

System

Users and Groups

Create user

$ sudo adduser «username»

Add user to group

$ sudo adduser «username» «group»

Remove user

$ sudo userdel «username»

Update Packages

$ sudo apt-get update
$ sudo apt-get upgrade

Copy Between Machines

To another machine

$ scp «localPath» «username»@«machineName»:«remotePath»

From another machine

$ scp «username»@«machineName»:«remotePath» «localPath» 

Service

Status

$ service --status-all

Change Status

$ sudo service «serviceName» start|stop|restart

Change Boot option

$ sudo systemctl start|stop|restart|reload|enable|disable «serviceName»

Disk Usage

$ df

CPU

$ cat /proc/cpuinfo
$ lscpu
$ top
$ htop

PowerShell

Show object properties

> «object» | Format-List *

Providers & Drives

> Get-PSProvider
> Get-PSDrive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment