Most Popular
1500 questions
82
votes
24 answers
Is there a robust command line tool for processing csv files?
I work with CSV files and sometimes need to quickly check the contents of a row or column from the command line. In many cases cut, head, tail, and friends will do the job; however, cut cannot easily deal with situations such as
"this, is the first…

Steven D
- 46,160
82
votes
3 answers
What's the difference between single and double equal signs (=) in shell comparisons?
Read that for comparing strings inside if we need to use double square brackets. Some books says that comparison can be done by =. But it works with the == too.
#!/bin/bash
a="hello"
b="world"
if [[ $a == $b ]];then
echo "equal"
fi
Is there a…

user3539
- 4,378
82
votes
2 answers
Is there an easy way to update information in known_hosts when you know that a hosts key has changed?
If a host's operating system has been re-installed and had its public key regenerated sshing to it will of course fail because the new key doesn't match the old one.
Is there an easier way to tell ssh that you know that the host's key has changed…

Sam
- 1,063
82
votes
1 answer
Alias for directory listing sorted by time modified in reverse order
When I need to find my recently used files, this command:
ls -lt
lists in ascending order (by time), when there are lots files, I need to scroll to
the top to see needed files, because won't fit in terminal screen.
After finding out that tac…

linux-newbie
- 859
- 1
- 7
- 4
82
votes
4 answers
What's the newline symbol in zsh's PS1?
I'm trying to setup a multiple line PS1, for zsh, but \n doesn't was parsed by zsh,
PS1="%~\n %> "
How should I set it up?

daisy
- 54,555
82
votes
10 answers
Converting colored output into html
There are tools providing coloured output:
dwdiff -c File1 File2 # word level diff
grep --color=always # we all know this guy
...
The question is: How to convert their colored output of arbitrary program into coloured html file?
Other output…

Grzegorz Wierzowiecki
- 14,264
82
votes
6 answers
How to get permission number by string : -rw-r--r--
I need to set the same chmod, how to get number for -rw-r--r-- ?

cnd
- 1,933
82
votes
1 answer
How to set ulimits on service with systemd?
How would you set a ulimit on a systemd service unit?
This stackoverflow question explains that systemd ignores system ulimits
What would the syntax look like to set the following ulimits?
ulimit -c
ulimit -v
ulimit -m
[Unit]
Description=Apache…

spuder
- 18,053
82
votes
2 answers
How to create backup from symbolic links?
I have a directory with symbolic links to other directories. I want to archive the symbolic links, not as links but as archives containing the files of directories they refer to, using tar command. How can I do this?

hknik
- 2,334
- 3
- 25
- 26
82
votes
11 answers
A stop job is running for Session c2 of user
The following message appears almost every time I shutdown my computer:
A stop job is running for Session c2 of user ... (1min 30s)
It waits for 1min30s then continues the shutdown process. I follow this systemd shutdown diagnosis guide and get the…

dmn
- 965
82
votes
2 answers
How to change default new window directory from within the tmux
I recently moved from GNU screen to tmux.
I find it quite similar but with bigger support (I switched due to problem with escape-time in neovim- resolution was only for tmux).
Unfortunately in tmux I'm unable to find a similar command to…

lewiatan
- 1,129
82
votes
6 answers
What is the correct way to view your CPU speed on Linux?
I found two commands to output information about my CPU: cat /proc/cpuinfo and lscpu. /proc/cpuinfo shows that my CPU speed is 2.1 Ghz, whereas lspcu says it is 3167 Mhz. Which one is correct?
This is my exact output from cat /proc/cpuinfo about my…

Rohan
- 3,561
82
votes
1 answer
shell find -delete "directory not empty"
I try to delete backup files on my Synology NAS older than 30 days. The files are in a directory which is created during download of the backup files from my webserver.
After download, I want to check -mtime and then delete the older files.
Here…

grandd
- 939
82
votes
8 answers
pacman "exists on filesystem" error
I ran sudo pacman -Syu and I got some interesting errors reading:
error: failed to commit transaction (conflicting files)
and a long list of files followed by exists in filesystem. Full output is here: http://ix.io/lLw
It appears that many of…

modulitos
- 3,145
82
votes
12 answers
Why do I have to use sudo for almost everything?
If I understand the Linux philosophy correctly, sudo should be used sparingly, and most operations should be performed as an under-privileged user. But that doesn't seem to make sense, since I'm always having to input sudo, whether I'm managing…

user139248
- 845