Member-only story

5 Ways to Make Linux Commands Work the Way You Want

Rakan Khaled
6 min readNov 17, 2024
Image by Author

When you’re getting to grips with Linux and the command line, it’s important to unlock its full power. Most commands you run have a wealth of settings you can tweak to change what they do. You just need to know where to look.

1 Change Behavior With Command-Line Options

The most basic way to change how commands run is by passing options as arguments. You’ve probably used arguments without thinking about it; when you run a command like ls, for example:

ls docs/

Here, docs/ is an argument that tells ls which file to list. The command will run its default action: display the names of files in the docs directory, in columns across the screen.

However, ls has many options that you can use to change its behavior. These take the form of an argument beginning with a minus sign (“-”), between the command name and its other arguments:

Option

Behavior

-l

List files in long format.

-a

Include hidden files.

-d

List directories as files instead of showing their contents.

--

--

Rakan Khaled
Rakan Khaled

No responses yet