Most Popular
1500 questions
165
votes
10 answers
Manually generate password for /etc/shadow
I need to manually edit /etc/shadow to change the root password inside of a virtual machine image.
Is there a command-line tool that takes a password and generates an /etc/shadow compatible password hash on standard out?
Lorin Hochstein
- 8,077
- 17
- 50
- 56
165
votes
2 answers
How to disable auto suspend when I close laptop lid?
I'm using archlinux. It never auto-suspend before a recent system upgrade(maybe I updated the kernel?).
I think it is related to laptop-mode or acpid, so I stop them:
/etc/rc.d/laptop-mode stop
/etc/rc.d/acpid stop
I also edit…
heiz
- 1,803
- 2
- 12
- 7
165
votes
20 answers
A standard tool to convert a byte-count into human KiB MiB etc; like du, ls1
Is there a standard tool which converts an integer count of Bytes into a human-readable count of the largest possible unit-size, while keeping the numeric value between 1.00 and 1023.99 ?
I have my own bash/awk script, but I am looking for a…
Peter.O
- 32,426
- 28
- 115
- 163
164
votes
4 answers
How does the sticky bit work?
SUID
The sticky bit applied to executable programs flagging the system to keep an image of the program in memory after the program finished running.
But I don't know that what it's stored in memory. And how I can see them, in this case.?
lotusirous
- 3,609
- 5
- 17
- 11
164
votes
9 answers
Combine the output of two commands in bash
Is it possible to combine output from these two commands?
node ~/projects/trunk/index.js
python ~/projects/trunk/run.py run
Neither command exits so I'm not sure how to do this.
chovy
- 2,039
- 4
- 16
- 18
164
votes
9 answers
List only regular files (but not directories) in current directory
I can use ls -ld */ to list all the directory entries in the current directory. Is there a similarly easy way to just list all the regular files in the current directory? I know I can use find
find . -maxdepth 1 -type f
or stat
stat -c "%F %n" * |…
daniel kullmann
- 9,427
- 11
- 38
- 45
164
votes
7 answers
What does the .d stand for in directory names?
I know many directories with .d in their name:
init.d
yum.repos.d
conf.d
Does it mean directory? If yes, from what does this disambiguate?
UPDATE: I've had many interesting answers about what the .d means, but the title of my question was not well…
greg0ire
- 2,925
- 3
- 25
- 37
164
votes
6 answers
How can I count the number of lines of a file with common tools?
I am redirecting grep results to a file, and then using cat to show its contents on the screen. I want to know how many lines of results I have in my results file and then add it to some counter.
What will be the best way? Any relevant flag to grep…
k-man
164
votes
3 answers
The name > org.freedesktop.PolicyKit1 was not provided by any .service files
When attempting to launch system-config-users from command line, I get the following warning, and the tool does not open. I'm using CentOS 7 with Mate 1.8.1.
WARNING **: Error enumerating actions:
…
a coder
- 3,184
- 9
- 42
- 63
164
votes
9 answers
How to find out the dynamic libraries executables loads when run?
I want to find out the list of dynamic libraries a binary loads when run (With their full paths). I am using CentOS 6.0. How to do this?
nakiya
164
votes
3 answers
If you ^Z from a process, it gets "stopped". How do you switch back in?
I accidentally "stopped" my telnet process. Now I can neither "switch back" into it, nor can I kill it (it won't respond to kill 92929, where 92929 is the processid.)
So, my question is, if you have a stopped process on linux command line, how do…
bobobobo
- 1,765
- 2
- 11
- 6
163
votes
13 answers
How do I remove the first 300 million lines from a 700 GB txt file on a system with 1 TB disk space?
How do I remove the first 300 million lines from a 700 GB text file
on a system with 1 TB disk space total, with 300 GB available?
(My system has 2 GB of memory.)
The answers I found use sed, tail, head:
How do I delete the first n lines of a…
Kris
- 1,273
- 2
- 9
- 7
163
votes
9 answers
How to run grep with multiple AND patterns?
I would like to get the multi pattern match with implicit AND between patterns, i.e. equivalent to running several greps in a sequence:
grep pattern1 | grep pattern2 | ...
So how to convert it to something like?
grep pattern1 & pattern2 &…
greenoldman
- 6,086
- 16
- 54
- 65
163
votes
4 answers
Get the chmod numerical value for a file
In FreeBSD and also in Linux, how can I get the numerical chmod value of a file? For example, 644 instead of -rw-r--r--? I need an automatic way for a Bash script.
stefan.at.kotlin
- 3,007
- 7
- 32
- 35
163
votes
4 answers
-bash: sudo: command not found
I am trying to deploy django app.
When I print
apt-get update
I see
W: Unable to read /etc/apt/apt.conf.d/ - DirectoryExists (13: Permission denied)
W: Unable to read /etc/apt/sources.list.d/ - DirectoryExists (13: Permission denied)
W: Unable to…
user2950593
- 1,797
- 2
- 13
- 9