Basic linux commands
Happy 30th birthday, Linux! Thirty years ago, on August 25th, 1991, 21-year-old Finnish student Linus Benedict Torvalds made his now-famous announcement on the comp.os.minix news group, saying that he’s working on a free operating system for 386(486) AT clones, just as a hobby.
Hello everybody out there using minix – I’m doing a (free) operating system (just a hobby, won’t be big and professional like gnu) for 386(486) AT clones. This has been brewing since april, and is starting to get ready. I’d like any feedback on things people like/dislike in minix, as my OS resembles it somewhat (same physical layout of the file-system (due to practical reasons) among other things).
I’ve currently ported bash(1.08) and gcc(1.40), and things seem to work. This implies that I’ll get something practical within a few months, and I’d like to know what features most people would want. Any suggestions are welcome, but I won’t promise I’ll implement them 🙂 Linus
PS. Yes – it’s free of any minix code, and it has a multi-threaded fs. It is NOT portable (uses 386 task switching etc), and it probably never will support anything other than AT-harddisks, as that’s all I have :-(.
Thirty years later, as you can already guess, the little hobby project called “Linux” now runs the technology world. To celebrate this milestone, I’m listing the thirty basic/most-used commands on GNU/Linux operating system.
Side note: this is also requested by a friend of mine on Threema called Niko 🙂. Click to view the messages:
||Display file’s contents to the standard output device (usually your monitor).|
||Change to directory.|
||Change a file’s permissions.|
||Change who owns a file.|
||Clear a command line screen/window for a fresh start.|
||Copy files and directories.|
||Display or set the system date and time.|
||Display used and available disk space.|
||Show how much space each file takes up.|
||Determine what type of data is within a file.|
||Search for files matching a provided pattern.|
||Search files or output for a particular pattern.|
||Stop a process. If the process refuses to stop, use kill -9 pid.|
||View the contents of a file one page at a time.|
||Create a shortcut.|
||Search a copy of your filesystem for the specified filename.|
||Send a print job.|
||List directory contents.|
||Display the help information for the specified command.|
||Create a new directory.|
||Rename or move file(s) or directories.|
||Change the password or allow (for the system administrator) to change any password.|
||Display a snapshot of the currently running processes.|
||Display the pathname for the current directory.|
||Remove (delete) file(s) and/or directories.|
||Delete empty directories.|
||Remotely log in to another Linux machine, over the network. Leave an ssh session by typing exit.|
||Switch to another user account.|
||Display who is logged on.|
Other usefull terminal tricks
Here are some other terminal commands that you may find helpfull.
curl is a “command line tool and library for transferring data with URLs.” It is a handy multitool that supports many network protocols. Some basic commands are:
curl --head [domainname]displays HTTP response headers (including security-relevant headers).
curl --header '[header]' [domainname]adds the ‘[header]’ to your request.
curl --insecure https://[domainname]connects to the domain and ignores any certificate errors.
curl --sslv3 https://[domainname]connects to the domain using insecure SSLv3 (also works for other insecure SSL/TLS versions).
curl -u user:password -O ftp://domainname/filedownloads a file using username and password authentication via FTP.
dig is part of BIND and can be used to check domains for DNSSEC:
dig [domain-name] +multiline
- “status” should be “NOERROR” (“SERVFAIL” means that there is a problem with the DNS server configuration, e.g., DNSSEC configuration is broken)
- “flags” must contain “ad” (authentic data)
dig [domain-name] +multiline +dnssec
- This query sets the “DNSSEC OK” (DO) bit and requests DNSSEC records to be sent, if available
- Look for “RRSIG” resource records
dig [domain-name] +trace
- This query emulates a DNS resolver. It starts from the root of the DNS hierarchy and works down using iterative DNS queries.
Well-known tools use imagemagick, so it is likely that imagemagick is already installed on your machine. You can use it to remove metadata from photos:
mogrify -strip [filename]
- “-strip” means “strip the image of any profiles, comments or these PNG chunks: bKGD, cHRM, EXIF, gAMA, iCCP, iTXt, sRGB, tEXt, zCCP, zTXt and date”
identify -format '%[EXIF:*]' [filename]
pwgen is a password generator:
Create passwords containing upper-case and lower-case chars, digits and special chars:
pwgen -scyn1 [number-of-characters] [number-of-passwords]
Create passwords containing upper-case and lower-case chars and digits:
pwgen -scn1 [number-of-characters] [number-of-passwords]
qrencode can be used to transform arbitrary strings into QR codes:
qrencode -o [qr-filename].png '[string]'
- Change the pixel size:
qrencode -o [qr-filename].png -s [pixel-size] '[string]'
subnetcalc is a CLI-based calculator for subnets of IPv4 and IPv6 networks.
subnetcalc 192.168.1.1/24prints network, netmask, broadcast address, max. hosts, properties, and more.
subnetcalc ashpex.eu.orgprints IP addresses, properties, geo-information about the IP address, and more.
If you find this post helpful, please consider sponsoring.Sponsor