Most Popular
1500 questions
110
votes
5 answers
Can't Install build-essential on CentOS
When I run the command:
sudo apt-get install build-essential
I get the following error message:
Reading Package Lists... Done
Building Dependency Tree... Done
E: Couldn't find package build-essential

Waley Chen
- 1,253
110
votes
10 answers
Does `sl` ever show the current directory?
For those out of the loop, sl is a humourous command line tool that is meant to trip people up if they mistype ls. When invoked it prints a Steam Locomotive. For example:
( ) (@@) ( ) (@) () @@ O @ O @ …
user53306
110
votes
8 answers
rsync ignore owner, group, time, and perms
I want to know how use rsync for sync to folders recursive but
I only need to update the new files or the updated files (only the content not the owner, group or timestamp) and I want to delete the files that not exist in the source.

alsanal
- 1,203
109
votes
6 answers
List subdirectories only n level deep
Festival stores voicepack data in the following example directory structure:
/usr/share/festival/voices//
What is the simplest one-liner (preferably using ls) to print out just the 's, in all the potentially…

user66001
- 2,395
109
votes
5 answers
How to open the same directory in another panel in Midnight Commander?
In Midnight Commander, how to quickly set the right panel to the same directory as the left panel (and vice versa)?

Ivan
- 17,708
109
votes
5 answers
Why are true and false so large?
After finding out that several common commands (such as read) are actually Bash builtins (and when running them at the prompt I'm actually running a two-line shell script which just forwards to the builtin), I was looking to see if the same is true…

Kidburla
- 1,286
109
votes
5 answers
Are all bash scripts compatible with `zsh`?
I'm looking to switch from bash to zsh but concerned about compatibility of bash scripts.
Are all bash scripts/functions compatible with zsh? Therefore, if that is true is zsh just an enhancement to bash?

chrisjlee
- 8,523
109
votes
7 answers
Set and Shopt - Why Two?
set and shopt are both shell builtins that control various options. I often forget which options are set by which command, and which option sets/unsets (set -o/+o, shopt -s/-u). Why are there two different commands that seemingly do the same thing…

Kevin
- 40,767
109
votes
7 answers
Does rsync verify files copied between two local drives?
I want to make a fresh new copy of a large number of files from one local drive to another.
I've read that rsync does a checksum comparison of files when sending them to a remote machine over a network.
Will rsync make the comparison when copying…

Frez
- 1,193
109
votes
11 answers
How to view a binary file?
From what I understand, a compiler makes a binary file that consists of 1's and 0's that a CPU can read. I have a binary file but how do I open it to see the 1's and 0's that are there? A text editor says it can't open it...
P.S. I have an assembly…

Martin Zeltin
- 1,241
- 2
- 9
- 6
109
votes
4 answers
Understanding "IFS= read -r line"
I obviously understand that one can add value to internal field separator variable. For example:
$ IFS=blah
$ echo "$IFS"
blah
$
I also understand that read -r line will save data from stdin to variable named line:
$ read -r line <<< blah
$ echo…

Martin
- 7,516
109
votes
7 answers
How to strip multiple spaces to one using sed?
sed on AIX is not doing what I think it should.
I'm trying to replace multiple spaces with a single space in the output of IOSTAT:
# iostat
System configuration: lcpu=4 drives=8 paths=2 vdisks=0
tty: tin tout avg-cpu: % user % sys %…

WernerCD
- 1,334
109
votes
22 answers
Detect init system using the shell
This may have more to do with detecting operating systems, but I specifically need the init system currently in use on the system.
Fedora 15 and Ubuntu now use systemd, Ubuntu used to use Upstart (long time default until 15.04), while others use…

beatgammit
- 7,583
109
votes
6 answers
How do I kill all a user's processes using their UID
I want to kill all running processes of a particular user from either a shell script or native code on a Linux system.
Do I have to read the /proc directory and look for these?
Any ideas? Is there a dynamic mapping of the pids under UIDs in Linux?…

user489152
- 1,193
109
votes
4 answers
What is the difference between 'rm' and 'unlink'?
Assuming you know the target is a symbolic link and not a file, is there any difference between using rm and unlink to remove the link?

IQAndreas
- 10,345