Most Popular
1500 questions
212
votes
4 answers
Why do we use su - and not just su?
I don't understand why su - is preferred over su to login as root.
Dharmit
- 4,220
- 7
- 28
- 37
212
votes
9 answers
ssh-add is not persistent between reboots
I added a ssh key to the agent by:
$ ssh-add ~/.ssh/id_rsa_mac
Identity added: /Users/alex/.ssh/id_rsa_mac (/Users/alex/.ssh/id_rsa_mac)
After a reboot the agent doesn't have this key added anymore:
$ ssh-add -l
The agent has no identities.
Why…
Incerteza
- 2,641
- 4
- 20
- 22
211
votes
2 answers
What is the difference between Docker, LXD, and LXC
What is the difference between Docker, LXD, and LXC. Do they offer the same services or different.
Ijaz Ahmad
- 7,146
- 5
- 32
- 45
210
votes
15 answers
How do I write a retry logic in script to keep retrying to run it upto 5 times?
I want to write logic in shell script which will retry it to run again after 15 sec upto 5 times based on "status code=FAIL" if it fails due to some issue.
Sandeep Singh
- 2,241
- 4
- 16
- 16
210
votes
8 answers
Run a command that is shadowed by an alias
Let's say I have the following alias in bash - alias ls='ls --color=auto' - and I want to call ordinary ls without options. Is the only way to do that is to unalias, do the command and then alias again? Or there is some nifty trick or workaround?
Mirzhan Irkegulov
- 8,248
- 11
- 45
- 54
210
votes
6 answers
How can I execute `date` inside of a crontab job?
I want to create a log file for a cron script that has the current hour in the log file name. This is the command I tried to use:
0 * * * * echo hello >> ~/cron-logs/hourly/test`date "+%d"`.log
Unfortunately I get this message when that…
cwd
- 44,479
- 71
- 146
- 167
210
votes
14 answers
How to determine Linux kernel architecture?
uname -m gives i686 and uname -m gives i686 i386 output in Red Hat Enterprise Linux Server release 5.4 (Tikanga) machine. I need to install Oracle Database 10g Release 2 on that machine. So, how can I decide whether kernel architecture is 32bit or…
user2914
- 2,521
- 5
- 21
- 15
209
votes
7 answers
How to stop the find command after first match?
Is there a way to force the find command to stop right after finding the first match?
Vombat
- 12,654
- 13
- 44
- 58
209
votes
5 answers
$VAR vs ${VAR} and to quote or not to quote
I can write
VAR=$VAR1
VAR=${VAR1}
VAR="$VAR1"
VAR="${VAR1}"
the end result to me all seems about the same. Why should I write one or the other? are any of these not portable/POSIX?
xenoterracide
- 57,918
- 74
- 184
- 250
209
votes
8 answers
Is Linux a Unix?
So, there are lots of different versions of Unix out there: HP-UX, AIX, BSD, etc. Linux is considered a Unix clone rather than an implementation of Unix. Are all the "real" Unices actual descendants of the original? If not, what separates Linux from…
Shawn J. Goff
- 45,338
- 25
- 134
- 145
208
votes
7 answers
Determine if Git working directory is clean from a script
I have a script which runs rsync with a Git working directory as destination. I want the script to have different behavior depending on if the working directory is clean (no changes to commit), or not. For instance, if the output of git status is as…
brentwpeterson
- 3,583
- 5
- 18
- 20
207
votes
10 answers
tmux vs. GNU Screen
Browsing through questions I found about tmux (I normally used GNU Screen). My question is what are pros and cons of each of them. Especially I couldn't find much about tmux.
Maciej Piechotka
- 16,578
- 11
- 57
- 93
207
votes
5 answers
Failed to fetch jessie backports repository
I'm using a docker image as a base for my own development that adds the jessie backports repository in its Dockerfile and uses that to install a dependency. This image uses the following command to add the repository:
echo "deb…
user12345
- 2,013
- 2
- 7
- 5
207
votes
4 answers
Where are Apache file access logs stored?
Does anyone know where file access logs are stored, so I can run a tail -f command in order to see who is accessing a particular file.
I have XAMPP, which is an Apache server installed on my machine, which automatically logs the accesses. It is…
AkshaiShah
- 3,599
- 5
- 18
- 9
206
votes
1 answer
How do you extract a single folder from a large tar.gz archive?
I am using this command on a 5GB archive
tar -zxvf archive.tar.gz /folder/in/archive
is this the correct way to do this? It seems to be taking forever with no command line output...
Garrett Hall
- 5,121
- 5
- 19
- 12