Most Popular

1500 questions
82
votes
3 answers

Why doesn't cp have a progress bar like wget?

Please note that I don't ask how. I already know options like pv and rsync -P. I want to ask why doesn't cp implement a progress bar, at least as a flag ?
Lamnk
  • 1,450
  • 1
  • 11
  • 10
82
votes
4 answers

What could DUP mean when using ping?

What could DUP mean when using ping?
LanceBaynes
  • 39,295
  • 97
  • 250
  • 349
82
votes
3 answers

How does /usr/bin/env know which program to use?

When I use the shebang #!/usr/bin/env python to run a script, how does the system know which python to use? if I look for a python bin path in the environment variables I find nothing. env | grep -i python
tMC
  • 1,175
  • 1
  • 9
  • 12
81
votes
2 answers

What do square brackets mean without the "if" on the left?

As far as I know, square brackets are used to enclose an expression usually in if else statements. But I found square brackets being used without the "if" as follows: [ -r /etc/profile.d/java.sh ] && . /etc/profile.d/java.sh in the following…
supertonsky
  • 913
  • 1
  • 7
  • 6
81
votes
8 answers

rsync all files of remote machine over SSH without root user?

I have this command to backup a remote machine. The problem is that I need root rights to read and copy all files. I have no root user enabled for security reasons and use sudo the Ubuntu way. Would I need some cool piping or something to do…
redanimalwar
  • 1,027
  • 1
  • 10
  • 13
81
votes
2 answers

Command line: <<< instead of <<

Why is the command md5sum <<< 'ddd' (output: d6d88f2e50080b9602da53dac1102762 -) right, and md5sum << 'ddd' not? What does <<< mean?
Jean Paulus
  • 811
  • 1
  • 7
  • 3
81
votes
8 answers

Best way to remove bytes from the start of a file?

Today I had to remove the first 1131 bytes from an 800MB mixed text / binary file, a filtered subversion dump I'm hacking for a new repository. What's the best way to do this? To start with I tried dd bs=1 skip=1131 if=filtered.dump…
Rup
  • 913
  • 1
  • 7
  • 11
81
votes
5 answers

Bash: How to read one line at a time from output of a command?

I am trying to read the output of a command in bash using a while loop. while read -r line do echo "$line" done <<< $(find . -type f) The output I got ranveer@ranveer:~/tmp$ bash test.sh ./test.py ./test1.py ./out1 ./test.sh ./out ./out2…
RanRag
  • 5,675
  • 6
  • 20
  • 15
81
votes
1 answer

vi - How go to line N?

In vi editor how do I go to a particular line ? For example if I open a file named file.py is there an option for open the file at a particular line or can I open my file and then go to line with keybord shortcut ?
Antoine Subit
  • 2,019
  • 2
  • 11
  • 10
81
votes
4 answers

No sha256sum in MacOS

I tried to use sha256sum in High Sierra; I attempted to install it with MacPorts, as: sudo port install sha256sum It did not work. What to do?
Rui F Ribeiro
  • 55,929
  • 26
  • 146
  • 227
81
votes
5 answers

Remove unused packages

I have installed some rpm package on my Fedora 17. Some packages had a lot of dependencies. I have removed some packages but I forgot remove unused dependencies with yum remove. How can I do that now?
mudlee
81
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,324
  • 3
  • 25
  • 26
81
votes
4 answers

How to mount a disk image from the command line?

I know how to mount a drive that has a corresponding device file in /dev, but I don't know how to do this for a disk image that does not represent a physical device and does not have an analogue in /dev (e.g. an ISO file or a floppy image). I know…
user628544
  • 1,495
  • 2
  • 12
  • 16
81
votes
13 answers

Why write an entire bash script in functions?

At work, I write bash scripts frequently. My supervisor has suggested that the entire script be broken into functions, similar to the following example: #!/bin/bash # Configure variables declare_variables() { noun=geese count=three } #…
Doktor J
  • 2,622
  • 2
  • 15
  • 18
81
votes
3 answers

What's the quickest way to find duplicated files?

I found this command used to find duplicated files but it was quite long and made me confused. For example, if I remove -printf "%s\n", nothing came out. Why was that? Besides, why have they used xargs -I{} -n1? Is there any easier way to find…
The One
  • 4,662
  • 11
  • 29
  • 35