Unix and Linux Weekly Newsletter

Top new questions this week:

touch all folders in a directory

I am trying to update the timestamps of all folders in the cwd using this: for file in `ls`; do touch $file; done But it doesn't seem to work. Any ideas why?

/ bash  
asked by javamonkey79 4 votes
answered by Michael Mrozek 13 votes

Error with if [ -n $diffCurr ]: Too many arguments

I have been using the below code ok for sometime, but now, I get an error java Editor < "input/editor$i.in" > "tmp/editor$i.out" diffCurr="$(diff "tmp/editor$i.out" "output/editor$i.out")" if [ …

/ bash / diff  
asked by jiewmeng 3 votes
answered by jw013 11 votes

How do ${0##*/} and ${0%/*} work?

I'm quite confused about the following regular expressions I found in a shell script: ${0##*/} ${0%/*} How do they work?

/ bash / shell / wildcards / parameter  
asked by user785099 7 votes
answered by jasonwryan 17 votes

Why hard links not allowed to directories in UNIX/Linux

I read in text books that UNIX/Linux doesn't allows hard links to directories but soft links do. Is it because, when we have cycles and if we create hardlinks, and after some time we delete the …

/ filesystems / directory / symlink / hardlink  
asked by user3539 12 votes
answered by Danny Dulai 16 votes

Show lines matching a pattern and the 4 lines before each

For example, from this file: CREATE SYNONYM I801XS07 FOR I8010.I801XT07 * ERROR at line 1: ORA-00955: name is already used by an existing object CREATE SYNONYM I801XS07 FOR …

/ command-line / grep / sed / awk / hp-ux  
asked by Javier Ortega 3 votes
answered by Bruce Ediger 4 votes

Why can't I have a folder and a file with the same name?

I've never had this problem before, but for some reason, I can't rename my folder to packages/. This is the structure: root - packages_old/ - packages When I try to rename the folder with …

/ files / directory / rename / filenames  
asked by Blender 2 votes
answered by Chris Down 10 votes

How to connect to a serial port as simple as using SSH?

Is there a way to connect to a serial terminal just as you would do with SSH? There must be a simpler way than tools such as Minicom, like this $ serial /dev/ttyS0 I know I can cat the output …

/ command-line / terminal / tty  
asked by ihatetoregister 2 votes
answered by rozcietrzewiacz 4 votes

Greatest hits from previous weeks:

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 …

/ linux / unix / history  
asked by Shawn J. Goff 14 votes
answered by Gilles 26 votes

Is there any way to keep a command from being added to your history?

Is there any way to keep a command from being added to your history? I have a command that I want to keep out of my history file, and I really don't care to have it there when I search the history …

/ bash / security / zsh / command-history  
asked by xenoterracide 13 votes
answered by dogbane 10 votes

Can you answer these?

Is there an easy way to list the number of unique values in a column in LibreOffice calc?

In LibreOffice calc I have a column with thousands of values. Is there an easy way to list the number of UNIQUE values? e.g. a column which had red red red green green blue blue blue …

/ openoffice  
asked by user11489 1 vote

How to make dnsmasq avoid DNS cache poisoning?

Some domain gets DNS cache poisoning if dnsmasq is the nameserver. But the problem is gone if switch to BIND (named). Is there a easy configuration of dnsmasq so that DNS cache poisoning can be …

/ security / dns / dnsmasq  
asked by Cheng 1 vote

Fix Fn-keys for keyboard illumination

I've tried following the Ubuntu hotkeys/media keys troubleshooting guide and /usr/share/doc/udev/README.keymap.txt.gz to make the Fn keys work. After copying the map file and modifying …

/ linux / keyboard / linux-hotplug  
asked by l0b0 1 vote
Subscribe to more Stack Exchange newsletters


Unsubscribe from this newsletter or change your email preferences by visiting your subscriptions page on stackexchange.com.

Questions? Comments? Let us know on our feedback site. If you no longer want to receive mail from Stack Exchange, unsubscribe from all stackexchange.com emails.

Stack Exchange, Inc. One Exchange Plaza, 26th Floor, NY NY 10006 <3