Reputation
3,322
Top tag
Next privilege 5,000 Rep.
Approve tag wiki edits
Badges
1 6 21
Impact
~390k people reached

Apr
14
comment Sending mails from Linux
If you are running sendmail try echo "This is the message body" | mail -s "This is the subject" -r chhaya.vishwakarma@example.com chhaya.vishwakarma@example.com Then check sendmail -bp
Apr
13
comment Read files from directory and organize them by extentsion into corresponding folders
@letda, leave it out. You don't have to specify each file separately. The if [[ "${files[@]#*.}" == *jpg* ]]; .... will loop through the array and compare the extension. If the extension matches, then action is taken.
Apr
13
comment Read files from directory and organize them by extentsion into corresponding folders
Ok on top of my head for f in jpg mov; do files=(*."$f"); if [[ "${files[@]#*.}" == *jpg* ]]; then mv "${files[@]}" jpgdir/; else mv "${files[@]}" movies/; fi; done This should get you going. If you prefer to use switch you can do so. Try to understand this one liner and see if it fits your situation
Apr
7
reviewed Approve Define a variable to awk pattern matching from bash
Apr
6
comment How to search a log file in Linux and escape special characters like square brackets (i.e. [ and ])
Have you tried to use /ERROR \[section_NAME\]
Apr
6
revised How to search a log file in Linux and escape special characters like square brackets (i.e. [ and ])
Layout
Apr
6
comment SELinux crashed data system
You could try the same and use systemd.unit=emergency.target in the same line but this time don't include rd.break. Try to restore the SELinux context from there. Can you update your question and explain what you tried. Did it allow you to enter the grub menu? Did it responde to the commands I described above in my answer section?
Apr
6
comment SELinux crashed data system
Well the procedure above doesn't get you to mDNS/DNS-SD. It breaks in a very early stage of initramfs At this point nothing really is mounted or loaded.
Apr
6
answered SELinux crashed data system
Mar
31
comment Disabling USB automount in GNOME3
There is also a thread here: unix.stackexchange.com/questions/85061/…
Mar
31
answered Disabling USB automount in GNOME3
Mar
31
revised How do I display all the characters between two specific strings?
fixing some typos
Mar
31
answered How do I display all the characters between two specific strings?
Mar
31
comment Iterating over glob patterns, not the files in them
Wat is your input and desired output? I'm not sure if people can read minds.
Mar
31
comment awk - combine two filters into one
@Nahshonpaz df has the --output flag that can be very useful in such situations. e.g df -m / --output=avail |tail -n1 or if you want to use awk df -m / --output=avail |awk 'getline' And if you want to use purely bash syntax: read -d '' -ra df_arr < <(LC_ALL=C df -mP /); echo "${df_arr[10]}"
Mar
30
comment Why doesn't my bash terminal recognize any command in the shell?
@Benjamin It seems like your PATH variable is not set properly. Try to use absolute paths i.e /bin/ls /home/${USER} I
Mar
30
comment How to use crontab to shutdown linux for every saturday 3PM
@guido you probably meant 0 15 * * Sat shutdown -h now
Mar
22
comment Syntax error unexpected end of file
@L.Docherty this makes sure that the script looks at whatever shell is availiable on your path. It is more portable. If you are running a recent version of ubuntu or fedora or any other distribution, #!/bin/bash would work as well.
Mar
22
comment Syntax error unexpected end of file
@L.Docherty correct. Integers in usernames on *nix are allowed though but they may not start with an integer. E.g 12345 as a username is not allowed where abc1234 is allowed. You just run the script, test it a bit and modify it to your needs.
Mar
22
comment Syntax error unexpected end of file
I mean the user input. You never know if a user will put a _ or a ` ` <-- space etc. Anyways, you now should have a bit of an idea of what this script does.