大约有 7,400 项符合查询结果(耗时:0.0309秒) [XML]
How to gzip all files in all sub-directories into one compressed file in bash
...d how things are tarred up/extracted, for example if I run
cd ~
tar -cvzf passwd.tar.gz /etc/passwd
tar: Removing leading `/' from member names
/etc/passwd
pwd
/home/myusername
tar -xvzf passwd.tar.gz
this will create
/home/myusername/etc/passwd
unsure if all versions of tar do this:
Remo...
How to generate an openSSL key using a passphrase from the command line?
...assword being viewable as a process use a function in a shell script:
get_passwd() {
local passwd=
echo -ne "Enter passwd for private key: ? "; read -s passwd
openssl genpkey -aes-256-cbc -pass pass:$passwd -algorithm RSA -out $PRIV_KEY -pkeyopt rsa_keygen_bits:$PRIV_KEYSIZE
}
...
How to make “if not true condition”?
I would like to have the echo command executed when cat /etc/passwd | grep "sysa" is not true.
6 Answers
...
How can you run a command in bash over until success
...
until passwd
do
echo "Try again"
done
or
while ! passwd
do
echo "Try again"
done
share
|
improve this answer
|
...
How can I change my Cygwin home folder after installation?
...de for details.
If you installed Cygwin prior to 1.7.34 or have run its mkpasswd utility so that you have an /etc/passwd file, you can change your Cygwin home directory by editing your user's entry in that file. Your home directory is the second-to-last element on your user's line in /etc/passwd.¹...
How to automatically add user account AND password with a Bash script?
...
You can run the passwd command and send it piped input. So, do something like:
echo thePassword | passwd theUsername --stdin
share
|
imp...
How do I list all cron jobs for all users?
...
You would have to run this as root, but:
for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done
will loop over each user name listing out their crontab. The crontabs are owned by the respective users so you won't be able to see another user's crontab w/o being them or root.
Ed...
Read lines from a file into a Bash array [duplicate]
...t newlines/CR
$ IFS=$'\r\n' GLOBIGNORE='*' command eval 'XYZ=($(cat /etc/passwd))'
$ echo "${XYZ[5]}"
sync:x:5:0:sync:/sbin:/bin/sync
Also note that you may be setting the array just fine but reading it wrong - be sure to use both double-quotes "" and braces {} as in the example above
Edit:
...
How to list all users in a Linux group?
... for your environment.
Edit 2: Someone in passing reminded me that getent passwd will return a list of all users on the system including ones from LDAP/NIS/etc., but getent group still will still miss users that are members only via the default group entry, so that inspired me to write this quick h...
Http Basic Authentication in Java using HttpClient?
... HttpGet httpGet = new HttpGet("https://httpbin.org/basic-auth/user/passwd");
String encoding = DatatypeConverter.printBase64Binary("user:passwd".getBytes("UTF-8"));
httpGet.setHeader("Authorization", "Basic " + encoding);
HttpResponse response = Client.execute(httpGe...
