Linux

Linux is a family of open-source Unix-like operating systems based on the Linux kernel. Some of the most popular Linux distributions include Debian, Fedora, and Ubuntu.

www.linux.org

linux - Linux: Run level and restart

Linux: Run level and restart

Learn to shut down or restart your Linux system, warn users that the system is shutting down, and switch to a somewhat restrictive run level. This process is unfamiliar to many Linux enthusiasts. Next, Ian Shields, a senior programmer from...

MobaXterm Personal 20.3 0UYr6Hl4lh 697x491 - Unix/Linux Find Size of Files in a Directory

Unix/Linux Find Size of Files in a Directory

Wait… before I try to copy this directory recursively, how big is it?

du -sh /path/to/directory

-s : Display for the entire folder, not for all subfiles separately

-h : Display size in human-readable format: KB, GB, TB..

linux - 🔍 Search text files for a particular word or phrase

🔍 Search text files for a particular word or phrase

grep can search one or many files for a word or phrase. To search one file for the phrase “Libby the dog”, try this: grep "Libby the dog" file.txt Note that you use quotation marks around your phrase because you are searching for a...

linux - View a text file at the command line

View a text file at the command line

To view the first lines of a text file, use the head command. head file.txt = show first 10 lines of filehead -25 file.txt = show first 25 lines of file To view the last lines of a text file, use the tail command. tail...

linux - The root of Linux

The root of Linux

Linux        Linux is a collective name for a class of Unix computer operating systems. The name of the kernel of the Linux operating system is also “Linux”. The Linux operating system is also...

linux - Convert spaces to underscores using a script

Convert spaces to underscores using a script

I had several files that had spaces in their names and I wanted to convert those spaces to underscores. Here’s how I did it. If you don’t have one already, make a bin directory in your home directory: cd mkdir bin In...

linux - More or Less

More or Less

Less

ls | less

Commands to use with less:

space = move ahead a pageb = move back a pageq = quit less

linux - I can't remember the root password!

I can’t remember the root password!

When the LILO: prompt appears (or boot: prompt if you inserted a boot disk), enter: linux -s or linux single When the bash# prompt appears, enter: passwd This will then prompt you for a new root password, without asking for the old one...

linux - Symbolic/soft links & hard 🔗 links

Symbolic/soft links & hard 🔗 links

Soft links Pointers to programs, files, or directories located elsewhere (just like Windows shortcuts)If the original program, file, or directory is renamed, moved, or deleted, the soft link is broken. If you type ls -F you can see...