Most Popular

1500 questions
76
votes
2 answers

reading from serial from linux command line

I have a serial port device that I would like to test using linux command line. I am able to use stty and echo for sending commands to serial port, but when device responds I have no way of reading what is coming from serial port. I am using stty…
erin c
  • 873
  • 1
  • 6
  • 6
76
votes
7 answers

Tell fs to free space from deleted files NOW

Is there a way to tell the kernel to give back the free disk space now? Like a write to something in /proc/ ? Using Ubuntu 11.10 with ext4. This is probably an old and very repeated theme. After hitting 0 space only noticed when my editor couldn't…
Marcos
  • 2,275
  • 2
  • 23
  • 32
76
votes
3 answers

Server admin sent me a private key to use. Why?

I'm supposed to be accessing a server in order to link a company's staging and live servers into our deployment loop. An admin over on their side set up the two instances and then created a user on the server for us to SSH in as. This much I'm used…
Toby
  • 783
  • 1
  • 5
  • 7
76
votes
5 answers

How to check 'mdadm' RAIDs while running?

I'm starting to get a collection of computers at home and to support them I have my "server" linux box running a RAID array. Its currently mdadm RAID-1, going to RAID-5 once I have more drives (and then RAID-6 I'm hoping for). However I've heard…
djsmiley2kStaysInside
  • 1,326
  • 1
  • 10
  • 15
76
votes
7 answers

How to trick a command into thinking its output is going to a terminal

Given a command that changes its behaviour when its output is going to a terminal (e.g. produce coloured output), how can that output be redirected in a pipeline while preserving the changed behaviour? There must be a utility for that, which I am…
Amir
  • 1,531
  • 1
  • 14
  • 18
76
votes
13 answers

Correct locking in shell scripts?

Sometimes you have to make sure that only one instance of a shell script is running at the same time. For example a cron job which is executed via crond that does not provide locking on its own (e.g. the default Solaris crond). A common pattern to…
maxschlepzig
  • 56,316
  • 50
  • 205
  • 279
76
votes
9 answers

How to add new lines when using echo

Why does the following command not insert new lines in the generated file and what's the solution? $ echo "Line 1\r\nLine2" >> readme.txt $ cat readme.txt Line 1\r\nLine2
Dumbo
  • 1,516
  • 6
  • 16
  • 20
76
votes
8 answers

Who's got the other end of this unix socketpair?

I want to determine which process has the other end of a UNIX socket. Specifically, I'm asking about one that was created with socketpair(), though the problem is the same for any UNIX socket. I have a program parent which creates a…
Jonathon Reinhart
  • 1,821
  • 1
  • 16
  • 20
76
votes
4 answers

Why doesn't the tilde (~) expand inside double quotes?

According to this answer and my own understanding, the tilde expands to the home directory: $ echo ~ /home/braiam Now, whenever I want the shell expansion to work, i. e. using variable names such $FOO, and do not break due unexpected characters,…
Braiam
  • 35,380
  • 25
  • 108
  • 167
76
votes
6 answers

Duplicate entries in $PATH a problem?

I source bashrc's of few of my friends. So I end up having duplicate entries in my $PATH variable. I am not sure if that is the problem for commands taking long to start. How does $PATH internally work in bash? Does having more PATHS slow my start…
balki
  • 4,327
  • 5
  • 30
  • 44
76
votes
8 answers

Dark blue color in vim or ls output in linux

I have a problem with dark-blue color in vim or ls output. Because I'm using black background color, words colored in dark-blue are almost completely invisible. How can I address this problem?
user7477
76
votes
1 answer

Linux LXC vs FreeBSD jail

Are there any notable differences between LXC (Linux containers) and FreeBSD's jails in terms of security, stability & performance? On first look, both approaches look very similar.
Philipp Claßen
  • 4,689
  • 7
  • 29
  • 41
76
votes
6 answers

less searches are always case-insensitive

Trying to find out how to use case-insensitive searches in less I found this on serverfault. That seems to perfectly answer my question. The problem is: It doesn't work like that here (OpenSUSE 13.1; less 458). I had aliased less to less -WiNS but I…
Hauke Laging
  • 88,146
  • 18
  • 125
  • 174
76
votes
18 answers

Removing a directory from PATH

I'm trying to compile wxWidgets using MingW, and I have cygwin in my path, which seems to conflict. So I would like to remove /d/Programme/cygwin/bin from the PATH variable and I wonder if there is some elegant way to do this. The naive approach…
Devolus
  • 881
  • 1
  • 7
  • 7
75
votes
6 answers

Resources for portable shell programming

What resources exist for portable shell programming? The ultimate answer is to test on all targeted platforms, but that's rarely practical. The POSIX / Single UNIX specification is a start, but it tells neither you what the level of support of each…
Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175