How can I replace root / filesystem with another filesystem?

When the Linux kernel starts up, it uses initrd as the root / filesystem, then replaces that with a filesystem partition in fstab. Based on a test in an early init script, I want to replace that root / filesystem with another filesystem partition. How to do that?


Unable to boot VM: Error 13: Invalid or Unsupported Executable Format

I used VMWare vConverter and everything converted fine, but when I try to boot I get an error: ![Error 13: Invalid or unsupported executable format](http://i.stack.imgur.com/H4h4E.jpg) The physical machine boots correctly, so I don't think it is a source machine issue. I am not sure why the VM won't boot; aren't VMs exact copies of source machines?


Setting IFS for a single statement

I know that a custom IFS value can be set for the scope of a single command/built-in. Is there a way to set a custom IFS value for a single statement?? Apparently not, since based on the below the global IFS value is affected when this is attempted               #check environment IFS value, it is space-tab-newline     printf "%s" "$IFS" | od -bc     0000000 040 011 012                  \t  \n     0000003     #invoke built-in with custom IFS     IFS=$'\n' read -r -d '' -a arr <<< "$str"     #environment IFS value remains unchanged as seen below     printf "%s" "$IFS" | od -bc     0000000 040 011 012                  \t  \n     0000003          #now attempt to set IFS for a single statement     IFS=$'\n' a=($str)     #BUT environment IFS value is overwritten as seen below     printf "%s" "$IFS" | od -bc     0000000 012              \n          0000001


bash - reading user variable into bash script grep

I've tried every possible combination to get this bash script working. It's part of a larger script, and it basically prompts for a username (to check if it exists) and returns the appropriate response:               #! /bin/bash     # Script to see if User exists          clear     echo -n "Enter user to check: "     read $uzer          grep -c '^${uzer}:' /etc/passwd          if [ $? -eq 0 ]; then       echo "User does exist :)"     else       echo "No such user"     fi      In terminal the following works fine:               grep -c '^devuser1:' /etc/passwd     RETURNS: 1     grep -c '^devuser1234:' /etc/passwd     RETURNS: 0      I've tried many combinations of passing the read variable into `'^${uzer}:'` with no joy. Any ideas what else I can try?


How to read an IP address backwards?

If we have this string (IP address): `192.168.1.1` How can I derive the (DNS reverse record form) from this string, so it will be shown like `1.1.168.192.in-addr.arpa` using a shell script?


Trying to sort on two fields, second then first

I am trying to sort on multiple columns. The results are not as expected. Here's my data (people.txt):               Simon Strange 62     Pete Brown 37     Mark Brown 46     Stefan Heinz 52     Tony Bedford 50     John Strange 51     Fred Bloggs 22     James Bedford 21     Emily Bedford 18     Ana Villamor 44     Alice Villamor 50     Francis Chepstow 56      The following works correctly:               bash-3.2$ sort -k2 -k3 <people.txt                                                                                Emily Bedford 18                                                                                James Bedford 21                                                                                Tony Bedford 50                                                                                Fred Bloggs 22                                                                                Pete Brown 37                                                                                Mark Brown 46                                                                                Francis Chepstow 56                                                                                Stefan Heinz 52                                                                                John Strange 51                                                                                Simon Strange 62                                                                                Ana Villamor 44                                                                                Alice Villamor 50      But, the following does not work as expected:               bash-3.2$ sort -k2 -k1 <people.txt                                             Emily Bedford 18                                                                                James Bedford 21                                                                                Tony Bedford 50                                                                                Fred Bloggs 22                                                                                Pete Brown 37                                                                                Mark Brown 46                                                                                Francis Chepstow 56                                                                                Stefan Heinz 52                                                                                John Strange 51                                                                                Simon Strange 62                                                                                Ana Villamor 44                                                                                Alice Villamor 50      I was trying to sort by surname and then by first name, but you will see the Villamors are not in the correct order. I was hoping to sort by surname, and then when surnames matched, to sort by first name. It seems there is something about how this should work I don't understand. I could do this another way of course (using awk), but I want to understand sort. I am using the standard Bash shell on Mac OS X. Many thanks!


Sort only on the second column

I'm trying to sort a file where typically (not always) the lines are               whatever:[A-Ba-b0-9_]: values      where fields are separated with `:`. Some lines do not follow this pattern, I'm not interested in them, they can be anywhere in the output. I want to sort the lines only on the second column (and not on values), but when I do `sort -t: -k 2 myfile`, it sorts the file on all the line. How to use the `-k` in order to have what I need?


How does -k flag work in sort command?

I have got a dataset like this:               manufacturer,model,year,mileage,price     plym fury 1970 73 2500      chevy malibu 1999 60 3000     ford mustang 1965 45 10000     volvo s80 1998 102 9850     ford thundbd 2003 15 10500     chevy malibu 2000 50 3500     bmw 315i 1985 115 450     honda accord 2001 30 6000     ford taurus 2004 10 17000     toyota rav4 2002 180 750     chevy impala 1985 85 1550     ford explor 2003 25 9500      I am supposed to sort the file by the manufacturer and then by the price within a manufacturer. The book says that this command will do it:               sort -t ' '  a -k1,1 -k5      My question is that what is the difference between the command above and this command               sort -t ' '  a -k1 -k5      I checked the output of both of command alone with `-k1` and `-k1,1` like this               sort -t ' '  a -k1,1           sort -t ' '  a -k1      and both of them were the same, and why is it that when are adding `-k5` the output in these two cases are different. I am not able to understand the difference between `-k1` and `-k1,1` properly in terms of functioning, Can anyone explain this to me with the context of the given dataset.


Check if a file or folder has been patched already

Is it possible to know if a file has been patched already, before apply the patch? I need to do this in a script, any thoughts?


Can't change to Korean-named directory on my debian server

I made a _rsync_ backup of some directories from a macbook laptop to a debian server. Some of these have korean characters ( _Hangeul_ ) in their names. After fixing my server's locale, it displays well when I do a _ls_ for instance. But I can't _cd_ to it. Example:               $ ls -1 | head     한국어     dirA     dirB     …      But if try to go browse that directory:               $ cd 한 국 어     cd: 3: can't cd to 한국어      Any idea what's wrong and how to fix it ?


bash: Using read <<<"$VARIABLE" on a read-only root partition

Just by coincidence I had to use my ATA-ID-to-device-name script (found here: http://serverfault.com/questions/244944/linux-ata-errors-translating-to-a- device-name/426561#426561) on a **read-only** `/` partition. In case you're curious, it was an Ubuntu recovery console which will let you access your `/` partition, but will mount it read-only by default. I am glad about that, because otherwise I would probably never have found out that my script behaves strangely on a R/O system due to a specific line, this one:               IFS=: read HostMain HostMid HostSub <<< "$HostFull"      This does _not_ work if there is no write permission. I wouldn't have assumed it would fail, though. But apparently the `<<<` operator _does_ require to write some temporary file to somewhere. But is there any way to circumvent the creation of a temporary file, or, is there any way to specify where the file is written to? In the Ubuntu recovery console, there is---oddly enough---write permission on the `/run` directory, so that would do, if I could somehow "tell" `read` to write the temp file to somewhere else than usual.


Does tar create new inodes to be archived?

When tar is asked to archive a directory, does it create a new inode for each file system object? If yes, how does it query and save the meta-data? Won't the format of storing this inode metadata vary from system to system? How does tar maintain a consistent output?


Can I list only specific subdirectories?

I have a folder tree structure like               arndell     \_databases       \_daily       \_weekly     claremont     \_databases       \_daily       \_weekly     monte     \_databases       \_daily       \_weekly      and I am only after all files inside weekly and daily directories. Is there a way I can achieve that using shell command or commands? I tried `ls -R */weekly/` from the top folder but it didn't work.


Getting "Not found" message when running a 32-bit binary on a 64-bit system

I have currently a strange problem on debian (wheezy/amd64). I have created a chroot to install a server (i can't give any more detail about it, sorry). Let's call its path `/chr_path/`. To make things easy, I have initialized this chroot with a debootstrap (also wheezy/amd64). All seemed to work well inside the chroot but when I started the installer script of my serveur I got : `zsh: Not found /some_path/perl` (the installer includes a perl binary for some reasons) Naturally, I checked the `/some_path/` location and I found the "perl" binary. `file` in chroot environment returns :               /some_path/perl ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, not stripped      The file exists, seems ok, has correct rights. I can use `file`, `ls`, `vim` on it but as soon as I try to execute it - `./perl` for example - I get : `zsh: Not found ./perl`. This situation is quite ununderstable for me. Moreover :   * I can execute other basic binaries (/bin/ls,...) in the chroot without getting errors   * I have the same problems for other binaries that came with the project   * When I try to execute the binary from the main root (`/chr_path/some_path/perl`), it works.   * I have tried to put one of the binaries with a copy of my `ls`. I checked that the access rights were the same but this didn't change anything (one was working, and the other wasn't)


"No such file or directory" when I clearly see the file listed with correct permissions

> **Possible Duplicate:**   >  Getting "Not found" message when running a 32-bit binary on a 64-bit system Ok I feel like I'm having some sort of brain fade moment, please help me out. I just installed Unreal Tournament on my Linux Mint Debian Edition OS. The startup script was complaining about a missing file so I decided to check it out manually.               ~/Desktop $ ut     /usr/local/bin/ut: 78: ./ut-bin: not found     ~/Desktop $ cd /usr/local/games/ut/System/     /usr/local/games/ut/System $ ls -l ut-bin      -rwxrwxr-x 1 root staff 91336 Jan 28 11:33 ut-bin     /usr/local/games/ut/System $ ./ut-bin      bash: ./ut-bin: No such file or directory      `ut-bin` is a binary executable according to the `file` command. Why is bash complaining about a missing file? I tried executing it in another shell and got a similar error. I also launched a new terminal with no change. What am I missing here?


executable lies about own existence

Okay, I'm completely baffled on this one. I'm installing a piece of software called InterPro Scan for my superiors, and it is complaining about an executable not existing. Please see below.               root@cpt:/usr/local/lib/iprscan# bin/Linux/seqret      bash: bin/Linux/seqret: No such file or directory     root@cpt:/usr/local/lib/iprscan# ls bin/Linux/seqret      bin/Linux/seqret     root@cpt:/usr/local/lib/iprscan# stat bin/Linux/seqret        File: `bin/Linux/seqret'       Size: 949624          Blocks: 1856       IO Block: 4096   regular file     Device: 801h/2049d      Inode: 38541532    Links: 1     Access: (0755/-rwxr-xr-x)  Uid: ( 1257/ UNKNOWN)   Gid: ( 1055/ UNKNOWN)     Access: 2013-06-17 17:28:41.317364148 -0500     Modify: 2009-12-16 05:57:46.000000000 -0600     Change: 2013-06-17 17:28:33.049363860 -0500      Birth: -     root@cpt:/usr/local/lib/iprscan# md5sum bin/Linux/seqret      bc08e679fb146bc47e6f41636dcc1f88  bin/Linux/seqret     root@cpt:/usr/local/lib/iprscan# file /usr/local/lib/iprscan/bin/binaries/seqret          /usr/local/lib/iprscan/bin/binaries/seqret: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, not stripped      It exists! But it says it doesn't? I'm incredibly confused.               root@cpt:/usr/local/lib/iprscan# /usr/local/lib/iprscan/bin/iprscan -cli -i /usr/local/lib/iprscan/test.seq -o /usr/local/lib/iprscan/test.out -format raw -goterms -iprlookup      This calls the wrapper script:               /usr/local/lib/iprscan/conf/seqret.sh: line 18: /usr/local/lib/iprscan/bin/binaries/seqret: No such file or directory     /usr/local/lib/iprscan/bin/iprscan: checkParams: unable to create input files: formatSequences:       This is the original call to the wrapper script:               /usr/local/lib/iprscan/conf/seqret.sh  /usr/local/lib/iprscan/tmp/20130617/iprscan-20130617-17561022/iprscan-20130617-17561022.seqs > /usr/local/lib/iprscan/tmp/20130617/iprscan-20130617-17561022/iprscan-20130617-17561022.input.formatted: exit status 127      All of the input files exist. The wrapper script itself               root@cpt:/usr/local/lib/iprscan# cat /usr/local/lib/iprscan/conf/seqret.sh     #!/bin/bash          ##### NOTE ####     # Should be already set by iprscan_wrapper.pl.     # If not just add the full path to your iprscan installation     #IPRSCAN_HOME=/your/path/here/to/iprscan     ###############     IPRSCAN_HOME=/usr/local/lib/iprscan          #Needed for seqret & sixpack emboss applications     EMBOSS_ROOT=$IPRSCAN_HOME/conf     export EMBOSS_ROOT          EMBOSS_ACDROOT=$IPRSCAN_HOME/conf/acd     export EMBOSS_ACDROOT          # "$@" is related to the command line of formatcmd tag in file iprscan.conf.     $IPRSCAN_HOME/bin/binaries/seqret -osf fasta -auto -stdout "$@"


problem occur during installation of moses scripts

> **Possible Duplicate:**   >  /bin/sh: ./check-dependencies.pl: not found — but check-dependencies.pl > exists! I obtain an error when I compile `moses-script`, which reads as follows:               minakshi@minakshi-Vostro-3500:~/Desktop/monu/moses/scripts$ make release     # Compile the parts     make all     make[1]: Entering directory `/home/minakshi/Desktop/monu/moses/scripts'     # Building memscore may fail e.g. if boost is not available.     # We ignore this because traditional scoring will still work and memscore isn't used by default.     cd training/memscore ; \           ./configure && make \           || ( echo "WARNING: Building memscore failed."; \                echo 'training/memscore/memscore' >> ../../release-exclude )     checking for a BSD-compatible install... /usr/bin/install -c     checking whether build environment is sane... yes     checking for gawk... no     checking for mawk... mawk     checking whether make sets $(MAKE)... yes     checking for g++... g++     checking whether the C++ compiler works... yes     checking for C++ compiler default output file name... a.out     checking for suffix of executables...     checking whether we are cross compiling... no     checking for suffix of object files... o     checking whether we are using the GNU C++ compiler... yes     checking whether g++ accepts -g... yes     checking for style of include used by make... GNU     checking dependency style of g++... gcc3     checking for gcc... gcc     checking whether we are using the GNU C compiler... yes     checking whether gcc accepts -g... yes     checking for gcc option to accept ISO C89... none needed     checking dependency style of gcc... gcc3     checking for boostlib >= 1.31.0... yes     checking for cos in -lm... yes     checking for gzopen in -lz... yes     checking for cblas_dgemm in -lgslcblas... no     checking for gsl_blas_dgemm in -lgsl... no     checking how to run the C++ preprocessor... g++ -E     checking for grep that handles long lines and -e... /bin/grep     checking for egrep... /bin/grep -E     checking for ANSI C header files... yes     checking for sys/types.h... yes     checking for sys/stat.h... yes     checking for stdlib.h... yes     checking for string.h... yes     checking for memory.h... yes     checking for strings.h... yes     checking for inttypes.h... yes     checking for stdint.h... yes     checking for unistd.h... yes     checking n_gram.h usability... no     checking n_gram.h presence... no     checking for n_gram.h... no     checking for size_t... yes     checking for ptrdiff_t... yes     configure: creating ./config.status     config.status: creating Makefile     config.status: creating config.h     config.status: config.h is unchanged     config.status: executing depfiles commands     make[2]: Entering directory `/home/minakshi/Desktop/monu/moses/scripts/training/memscore'     make  all-am     make[3]: Entering directory `/home/minakshi/Desktop/monu/moses/scripts/training/memscore'     make[3]: Leaving directory `/home/minakshi/Desktop/monu/moses/scripts/training/memscore'     make[2]: Leaving directory `/home/minakshi/Desktop/monu/moses/scripts/training/memscore'     touch release-exclude # No files excluded by default     pwd=`pwd`; \         for subdir in cmert-0.5 phrase-extract symal mbr lexical-reordering; do \           make -C training/$subdir || exit 1; \           echo "### Compiler $subdir"; \           cd $pwd; \         done     make[2]: Entering directory `/home/minakshi/Desktop/monu/moses/scripts/training/cmert-0.5'     make[2]: Nothing to be done for `all'.     make[2]: Leaving directory `/home/minakshi/Desktop/monu/moses/scripts/training/cmert-0.5'     ### Compiler cmert-0.5     make[2]: Entering directory `/home/minakshi/Desktop/monu/moses/scripts/training/phrase-extract'     make[2]: Nothing to be done for `all'.     make[2]: Leaving directory `/home/minakshi/Desktop/monu/moses/scripts/training/phrase-extract'     ### Compiler phrase-extract     make[2]: Entering directory `/home/minakshi/Desktop/monu/moses/scripts/training/symal'     make[2]: Nothing to be done for `all'.     make[2]: Leaving directory `/home/minakshi/Desktop/monu/moses/scripts/training/symal'     ### Compiler symal     make[2]: Entering directory `/home/minakshi/Desktop/monu/moses/scripts/training/mbr'     make[2]: Nothing to be done for `all'.     make[2]: Leaving directory `/home/minakshi/Desktop/monu/moses/scripts/training/mbr'     ### Compiler mbr     make[2]: Entering directory `/home/minakshi/Desktop/monu/moses/scripts/training/lexical-reordering'     make[2]: Nothing to be done for `all'.     make[2]: Leaving directory `/home/minakshi/Desktop/monu/moses/scripts/training/lexical-reordering'     ### Compiler lexical-reordering     ## All files that need compilation were compiled     make[1]: Leaving directory `/home/minakshi/Desktop/monu/moses/scripts'     /bin/sh: ./check-dependencies.pl: not found     make: *** [release] Error 127      We don't know why this error occurs? check-dependencies.pl file existed in scripts folder ...


make: arm-elf-gcc: Command not found

I'm working on an application for a Moxa UC-7110, and I have installed their tool chain, which provides a cross compiler for their arm architecture on uClinux. I'm on on Ubuntu 12.04 LTS. I'm having trouble getting the compiler to work though. I was able to run the tool chain installer successfully, and I see the arm-elf-gcc compiler under /usr/local/bin along with others. However, when I run make, I get a command not found error. Here is the make file:               srcdir = .     LDFLAGS =  -Wl,-elf2flt     LIBS =       CFLAGS = --verbose          # Change these if necessary          CC = arm-elf-gcc      CPP = arm-elf-gcc -E          all:    hello          hello:         $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(LIBS) $@.c          clean:         rm -f $(OBJS) hello core *.gdb      I've checked my PATH:               /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin      And when I run `which arm-elf-gcc` I get `/usr/local/bin/arm-elf-gcc`. I even get tab completion, but when I try to run the `arm-elf-gcc` directly I still get `bash: /usr/local/bin/arm-elf-gcc: No such file or directory`. I've verified that the file exists, but for some reason Ubuntu doesn't see it. Any ideas?


I get "bash: ...: No such file or directory" even though the executable is there

Operating system: Lubuntu 13.10, 64-bit. I installed the Seamonkey browser from http://www.seamonkey-project.org/ following the instructions quoted below from http://www.seamonkey- project.org/doc/install-and-uninstall#install_linux > To install SeaMonkey by downloading the tar.bz2 file: > > Create a directory named "seamonkey2" (mkdir seamonkey2) and change to that > directory (cd seamonkey2).   >  Click the link on the site you're downloading SeaMonkey from to download > the package (seamonkey-2.*.tar.bz2) file into the seamonkey2 directory.   >  Decompress the file with the following command: > > `tar jxvf seamonkey-2.*.tar.bz2` > > This creates a "seamonkey" directory under your seamonkey2 directory.   >  Change to the seamonkey directory (cd seamonkey).   >  Run SeaMonkey with the following command: > > `./seamonkey` I followed the instructions but here is what I see with the following commands:               [05:28 PM] ~/seamonkey2/seamonkey $ ll seam*     -rwxr-xr-x 1 vasa1 vasa1 82816 Oct 29 08:23 seamonkey*     -rwxr-xr-x 1 vasa1 vasa1 82820 Oct 29 08:23 seamonkey-bin*      * * *               [05:28 PM] ~/seamonkey2/seamonkey $ seamonkey     bash: /home/vasa1/seamonkey2/seamonkey/seamonkey: No such file or directory     [05:28 PM] ~/seamonkey2/seamonkey $ seamonkey-bin     bash: /home/vasa1/seamonkey2/seamonkey/seamonkey-bin: No such file or directory     [05:28 PM] ~/seamonkey2/seamonkey $ ./seamonkey     bash: ./seamonkey: No such file or directory     [05:29 PM] ~/seamonkey2/seamonkey $ ./seamonkey-bin     bash: ./seamonkey-bin: No such file or directory     [05:29 PM] ~/seamonkey2/seamonkey $       So why is `bash` saying "No such file or directory" although the directory and files (seamonkey and seamonkey-bin) exist? Here is the output of `cat /etc/environment`:               [05:38 PM] ~ $ cat /etc/environment     PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/vasa1/seamonkey2/seamonkey"     [05:38 PM] ~ $       Here is the output of `file seamonkey` and `ldd seamonkey`:               [06:29 PM] ~/seamonkey2/seamonkey $ file seamonkey     seamonkey: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped     [06:30 PM] ~/seamonkey2/seamonkey $ ldd seamonkey         linux-gate.so.1 =>  (0xf7726000)         libpthread.so.0 => /lib32/libpthread.so.0 (0xf76f6000)         libdl.so.2 => /lib32/libdl.so.2 (0xf76f1000)         libstdc++.so.6 => not found         libm.so.6 => /lib32/libm.so.6 (0xf76ae000)         libgcc_s.so.1 => not found         libc.so.6 => /lib32/libc.so.6 (0xf74fc000)         /lib/ld-linux.so.2 (0xf7727000)     [06:31 PM] ~/seamonkey2/seamonkey $


When executable files aren't

> **Possible Duplicate:**   >  Can't execute some binaries in chroot environment (zsh: Not found) Today I ran into something that has me stumped. A co-worker is working with a specific pre-compiled binary he downloaded (available here). On the Ubuntu 10.04 LTS Server he's working on, attempting to execute this file yields file- not-found, even with permissions set right. And yet, when I attempt the same thing from OpenSUSE 11.4, it runs just fine. Running `file` on it gives me: > ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked > (uses shared libs), for GNU/Linux 2.6.15, stripped Both the Ubuntu and OpenSUSE boxes are 64-bit installs, and `file` returns the same information on both machines. Which looks just fine to me. And on the opensuse box, LDD even gives me a short list of library files. Hand checking, all of those specified files also exist on the Ubuntu server. Strace output is different though: Opensuse: > execve("./trid", ["./trid"], [/* 122 vars */]) = 0 Ubuntu (giving full path does not change result): > execve("./trid", ["./trid"], [/* 19 vars */]) = -1 ENOENT (No such file or > directory) What can cause a file like this to not be executable in this way?


skype not found on Oneiric 64, but it is right there

> **Possible Duplicate:**   >  Can't execute some binaries in chroot environment (zsh: Not found) I have something weird here. Cannot find a file although it is right there.               $ skype     command not found: skype     $ whereis skype     skype: /usr/bin/skype /usr/share/skype     $ /usr/bin/skype     file or directory not found: /usr/bin/skype     $ ls -l /usr/bin/skype     -rwxr-xr-x 1 root root 21362968 2011-06-08 12:26 /usr/bin/skype     $ type /usr/bin/skype     /usr/bin/skype is /usr/bin/skype     $ which skype     /usr/bin/skype      Any explanation for that? Happened only with skype so far, no matter if on zsh or bash. I'm on Ubuntu Natty 64, had not encountered anything like that before.


Getting 'no such file or directory' even though the file is clearly there

I'm having a perplexing issue. If I try to run a script via:               root@myServer:~/dig# ./minerd.sh      I get:               -bash: ./minerd.sh: No such file or directory      If I try:               root@myServer:~/dig# ~/dig/minerd.sh      I still get:               -bash: /root/dig/minerd.sh: No such file or directory      If I do:               root@myServer:~/dig# ls ~/dig/minerd.sh      Then I get:               /root/dig/minerd.sh      So, the file is clearly there. I have also previously done `chmod +x` on it. But still, its not allowing me to run it for some reason. What am I doing wrong? Edit: Even moving the file to a different name doesn't work:               root@myServer:~/dig# mv minerd.sh test.sh     root@myServer:~/dig# ./test.sh     -bash: ./test.sh: No such file or directory


Executable exists for everything but bash & file manager

I am running Debian. I was trying to use truecrypt the other day. I downloaded and extracted the zip, and ran the installer. I just extracted the file, and did not install it. I then tried executing it, and apparently it does not exist. First I just double clicked the file from thunar (xfce4 file manager), and it told me the file did not exist. I then tried the following:               ~$ cd /home/share/crypt/truecrypt/     /home/share/crypt/truecrypt$ ls -al truecrypt-linux_x86-64      -rwxrwxrwx 1 abstruselyarcane root 4873328 Feb  7  2012 truecrypt-linux_x86-64 #Its not a figment of my imagination     /home/share/crypt/truecrypt$ file truecrypt-linux_x86-64      truecrypt-linux_x86-64: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), stripped # It is indeed an executable     /home/share/crypt/truecrypt$ ./truecrypt-linux_x86-64      bash: ./truecrypt-linux_x86-64: No such file or directory # It doesn't exist?     /home/share/crypt/truecrypt$ sudo ./truecrypt-linux_x86-64      [sudo] password for abstruselyarcane:      sudo: unable to execute ./truecrypt-linux_x86-64: No such file or directory     /home/share/crypt/truecrypt$ ldd truecrypt-linux_x86-64          not a dynamic executable # file just said it is an executable!      I am very confused right now. EDIT: I has been suggested to be that I'm running a 64bit from a 32bit, I went to the other post, and tested my distro:               ~$ uname -m     x86_64


/bin/sh: ./check-dependencies.pl: not found — but check-dependencies.pl exists!

I'm trying to build Moses, but when I run `make` I get the following output:               minakshi@minakshi-Vostro-3500:~/Desktop/working-dir/moses/scripts$ make release     # Compile the parts     make all     make[1]: Entering directory `/home/minakshi/Desktop/working-dir/moses/scripts'     # Building memscore may fail e.g. if boost is not available.     # We ignore this because traditional scoring will still work and memscore isn't used by default.     cd training/memscore ; \           ./configure && make \           || ( echo "WARNING: Building memscore failed."; \                echo 'training/memscore/memscore' >> ../../release-exclude )     checking for a BSD-compatible install... /usr/bin/install -c     checking whether build environment is sane... yes     checking for gawk... no     checking for mawk... mawk     checking whether make sets $(MAKE)... yes     checking for g++... g++     checking whether the C++ compiler works... yes     checking for C++ compiler default output file name... a.out     checking for suffix of executables...      checking whether we are cross compiling... no     checking for suffix of object files... o     checking whether we are using the GNU C++ compiler... yes     checking whether g++ accepts -g... yes     checking for style of include used by make... GNU     checking dependency style of g++... gcc3     checking for gcc... gcc     checking whether we are using the GNU C compiler... yes     checking whether gcc accepts -g... yes     checking for gcc option to accept ISO C89... none needed     checking dependency style of gcc... gcc3     checking for boostlib >= 1.31.0... yes     checking for cos in -lm... yes     checking for gzopen in -lz... yes     checking for cblas_dgemm in -lgslcblas... no     checking for gsl_blas_dgemm in -lgsl... no     checking how to run the C++ preprocessor... g++ -E     checking for grep that handles long lines and -e... /bin/grep     checking for egrep... /bin/grep -E     checking for ANSI C header files... yes     checking for sys/types.h... yes     checking for sys/stat.h... yes     checking for stdlib.h... yes     checking for string.h... yes     checking for memory.h... yes     checking for strings.h... yes     checking for inttypes.h... yes     checking for stdint.h... yes     checking for unistd.h... yes     checking n_gram.h usability... no     checking n_gram.h presence... no     checking for n_gram.h... no     checking for size_t... yes     checking for ptrdiff_t... yes     configure: creating ./config.status     config.status: creating Makefile     config.status: creating config.h     config.status: config.h is unchanged     config.status: executing depfiles commands     make[2]: Entering directory `/home/minakshi/Desktop/working-dir/moses/scripts/training/memscore'     make  all-am     make[3]: Entering directory `/home/minakshi/Desktop/working-dir/moses/scripts/training/memscore'     make[3]: Leaving directory `/home/minakshi/Desktop/working-dir/moses/scripts/training/memscore'     make[2]: Leaving directory `/home/minakshi/Desktop/working-dir/moses/scripts/training/memscore'     touch release-exclude # No files excluded by default     pwd=`pwd`; \         for subdir in cmert-0.5 phrase-extract symal mbr lexical-reordering; do \           make -C training/$subdir || exit 1; \           echo "### Compiler $subdir"; \           cd $pwd; \         done     make[2]: Entering directory `/home/minakshi/Desktop/working-dir/moses/scripts/training/cmert-0.5'     make[2]: Nothing to be done for `all'.     make[2]: Leaving directory `/home/minakshi/Desktop/working-dir/moses/scripts/training/cmert-0.5'     ### Compiler cmert-0.5     make[2]: Entering directory `/home/minakshi/Desktop/working-dir/moses/scripts/training/phrase-extract'     make[2]: Nothing to be done for `all'.     make[2]: Leaving directory `/home/minakshi/Desktop/working-dir/moses/scripts/training/phrase-extract'     ### Compiler phrase-extract     make[2]: Entering directory `/home/minakshi/Desktop/working-dir/moses/scripts/training/symal'     make[2]: Nothing to be done for `all'.     make[2]: Leaving directory `/home/minakshi/Desktop/working-dir/moses/scripts/training/symal'     ### Compiler symal     make[2]: Entering directory `/home/minakshi/Desktop/working-dir/moses/scripts/training/mbr'     make[2]: Nothing to be done for `all'.     make[2]: Leaving directory `/home/minakshi/Desktop/working-dir/moses/scripts/training/mbr'     ### Compiler mbr     make[2]: Entering directory `/home/minakshi/Desktop/working-dir/moses/scripts/training/lexical-reordering'     make[2]: Nothing to be done for `all'.     make[2]: Leaving directory `/home/minakshi/Desktop/working-dir/moses/scripts/training/lexical-reordering'     ### Compiler lexical-reordering     ## All files that need compilation were compiled     make[1]: Leaving directory `/home/minakshi/Desktop/working-dir/moses/scripts'     /bin/sh: ./check-dependencies.pl: Permission denied     make: *** [release] Error 126     minakshi@minakshi-Vostro-3500:~/Desktop/working-dir/moses/scripts$ make release     # Compile the parts     make all     make[1]: Entering directory `/home/minakshi/Desktop/working-dir/moses/scripts'     # Building memscore may fail e.g. if boost is not available.     # We ignore this because traditional scoring will still work and memscore isn't used by default.     cd training/memscore ; \           ./configure && make \           || ( echo "WARNING: Building memscore failed."; \                echo 'training/memscore/memscore' >> ../../release-exclude )     checking for a BSD-compatible install... /usr/bin/install -c     checking whether build environment is sane... yes     checking for gawk... no     checking for mawk... mawk     checking whether make sets $(MAKE)... yes     checking for g++... g++     checking whether the C++ compiler works... yes     checking for C++ compiler default output file name... a.out     checking for suffix of executables...      checking whether we are cross compiling... no     checking for suffix of object files... o     checking whether we are using the GNU C++ compiler... yes     checking whether g++ accepts -g... yes     checking for style of include used by make... GNU     checking dependency style of g++... gcc3     checking for gcc... gcc     checking whether we are using the GNU C compiler... yes     checking whether gcc accepts -g... yes     checking for gcc option to accept ISO C89... none needed     checking dependency style of gcc... gcc3     checking for boostlib >= 1.31.0... yes     checking for cos in -lm... yes     checking for gzopen in -lz... yes     checking for cblas_dgemm in -lgslcblas... no     checking for gsl_blas_dgemm in -lgsl... no     checking how to run the C++ preprocessor... g++ -E     checking for grep that handles long lines and -e... /bin/grep     checking for egrep... /bin/grep -E     checking for ANSI C header files... yes     checking for sys/types.h... yes     checking for sys/stat.h... yes     checking for stdlib.h... yes     checking for string.h... yes     checking for memory.h... yes     checking for strings.h... yes     checking for inttypes.h... yes     checking for stdint.h... yes     checking for unistd.h... yes     checking n_gram.h usability... no     checking n_gram.h presence... no     checking for n_gram.h... no     checking for size_t... yes     checking for ptrdiff_t... yes     configure: creating ./config.status     config.status: creating Makefile     config.status: creating config.h     config.status: config.h is unchanged     config.status: executing depfiles commands     make[2]: Entering directory `/home/minakshi/Desktop/working-dir/moses/scripts/training/memscore'     make  all-am     make[3]: Entering directory `/home/minakshi/Desktop/working-dir/moses/scripts/training/memscore'     make[3]: Leaving directory `/home/minakshi/Desktop/working-dir/moses/scripts/training/memscore'     make[2]: Leaving directory `/home/minakshi/Desktop/working-dir/moses/scripts/training/memscore'     touch release-exclude # No files excluded by default     pwd=`pwd`; \         for subdir in cmert-0.5 phrase-extract symal mbr lexical-reordering; do \           make -C training/$subdir || exit 1; \           echo "### Compiler $subdir"; \           cd $pwd; \         done     make[2]: Entering directory `/home/minakshi/Desktop/working-dir/moses/scripts/training/cmert-0.5'     make[2]: Nothing to be done for `all'.     make[2]: Leaving directory `/home/minakshi/Desktop/working-dir/moses/scripts/training/cmert-0.5'     ### Compiler cmert-0.5     make[2]: Entering directory `/home/minakshi/Desktop/working-dir/moses/scripts/training/phrase-extract'     make[2]: Nothing to be done for `all'.     make[2]: Leaving directory `/home/minakshi/Desktop/working-dir/moses/scripts/training/phrase-extract'     ### Compiler phrase-extract     make[2]: Entering directory `/home/minakshi/Desktop/working-dir/moses/scripts/training/symal'     make[2]: Nothing to be done for `all'.     make[2]: Leaving directory `/home/minakshi/Desktop/working-dir/moses/scripts/training/symal'     ### Compiler symal     make[2]: Entering directory `/home/minakshi/Desktop/working-dir/moses/scripts/training/mbr'     make[2]: Nothing to be done for `all'.     make[2]: Leaving directory `/home/minakshi/Desktop/working-dir/moses/scripts/training/mbr'     ### Compiler mbr     make[2]: Entering directory `/home/minakshi/Desktop/working-dir/moses/scripts/training/lexical-reordering'     make[2]: Nothing to be done for `all'.     make[2]: Leaving directory `/home/minakshi/Desktop/working-dir/moses/scripts/training/lexical-reordering'     ### Compiler lexical-reordering     ## All files that need compilation were compiled     make[1]: Leaving directory `/home/minakshi/Desktop/working-dir/moses/scripts'     /bin/sh: ./check-dependencies.pl: not found     make: *** [release] Error 127      The error message says `./check-dependencies.pl` is "not found", but I see the file present in the `scripts` folder. So why does this error occur?


"No such file or directory" on files that exist?

In the past day, I've found at least 4 binaries that say "bin-name: No such file or directory" when I try to run them. Even if I type part of the name and tab complete it, I get the same error. I'm on an x86_64 architecture. Output of `file`:               fez-09152013-bin: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),     dynamically linked (uses shared libs), for GNU/Linux 2.6.24,     BuildID[sha1]=0x78612e4aac547367548dcc7cc3067c3cfcf2f177, stripped      Output of `strace`:               execve("./fez-09152013-bin", ["./fez-09152013-bin"], [/* 23 vars */]) = -1 ENOENT (No such file or directory)     dup(2)                                  = 3     fcntl(3, F_GETFL)                       = 0x8002 (flags O_RDWR|O_LARGEFILE)     fstat(3, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 1), ...}) = 0     mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3fda17a000     lseek(3, 0, SEEK_CUR)                   = -1 ESPIPE (Illegal seek)     write(3, "strace: exec: No such file or di"..., 40strace: exec: No such file or directory     ) = 40     close(3)                                = 0     munmap(0x7f3fda17a000, 4096)            = 0     exit_group(1)                           = ?      Output of `ldd`:               Not a dynamic executable      Output of `strings` is way too long to indent, so here's a link: http://pastebin.com/t7MmugLY apt-get error:               Reading package lists... Done     Building dependency tree            Reading state information... Done     Some packages could not be installed. This may mean that you have     requested an impossible situation or if you are using the unstable     distribution that some required packages have not yet been created     or been moved out of Incoming.     The following information may help to resolve the situation:          The following packages have unmet dependencies:      ia32-libs : Depends: ia32-libs-i386 but it is not installable     E: Unable to correct problems, you have held broken packages.


no such file or directory

I have a 64-bit Ubuntu and want to execute a 32-bit FreeRTOS binary. The error message says no such file or directory. The files are there I can read them with `ls -l`.


Linux From Scratch: make no such file or directory, bad interpreter

> **Possible Duplicate:**   >  Getting “Not found” message when running a 32-bit binary on a 64-bit system I have finished the chapter 5 of the book. And after I entered the chroot I realized that `make` is not working even though it is present.               root:/sources/linux-3.5.2# make mrproper     bash: /tools/bin/make: No such file or directory      the path is correct               echo $PATH     /bin:/usr/bin:/sbin:/usr/sbin:/tools/bin      AND                ls -l /tools/bin/make         -rwxr-xr-x 1 root root 559139 Nov 13 11:19 /tools/bin/make      I read on LFS FAQ that is probably due to a bad interpreter (link) so I did               readelf -l /tools/bin/make | grep interpreter           [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]      so it's wrong they said it should be something like **/tools/lib/ld- linux.so.2** Is there a way to precise when building it the right interpreter ? Thanks


Debian Wheezy 7.1 - can't launch Skype or Firefox

I've installed Skype by using `dkpg` and when I try to run it, this is what I get `-bash: /usr/bin/skype: No such file or directory`. Which is very strange since `ls -l | grep skype` shows this:               -rwxr-xr-x 1 root   root    30717480 May  7 01:43 skype      I had similiar problems when I installed FireFox, but since I didn't need it all that much, didn't care. However, I do need Skype on Linux. Output of my `$PATH` variable:               /home/max/.rvm/gems/ruby-2.0.0-p247/bin:/home/max/.rvm/gems/ruby-2.0.0-p247@global/bin:/home/max/.rvm/rubies/ruby-2.0.0-p247/bin:/home/max/.rvm/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games      Anyone care to explain?... Because I'm stunned.


Existing file can not be found?

/usr/share/tipp10$ ll     insgesamt 9408     drwxr-xr-x   3 myname ssl-cert    4096 Feb 26 20:07 ./     drwxr-xr-x 288 root   root       12288 Feb 26 20:07 ../     -rwxrwxrwx   1 myname ssl-cert    9480 Okt  6  2010 error.wav*     drwxrwxrwx   4 myname ssl-cert    4096 Feb 26 20:07 help/     -rwxrwxrwx   1 myname ssl-cert   16368 Dez 30  2010 license_de.txt*     -rwxrwxrwx   1 myname ssl-cert   16291 Dez 30  2010 license_en.txt*     -rwxrwxrwx   1 myname ssl-cert    5928 Okt  6  2010 metronome.wav*     -rwxrwxrwx   1 myname ssl-cert 9537480 Mär 11  2011 tipp10*     -rwxrwxrwx   1 myname ssl-cert    1255 Nov  7  2008 tipp10.png*     -rwxrwxrwx   1 myname ssl-cert   13312 Dez 18  2010 tipp10v2.template*          /usr/share/tipp10$ pwd tipp10     /usr/share/tipp10          /usr/share/tipp10$ file tipp10     tipp10: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.4, not stripped          manuel@P5KC:/usr/share/tipp10$ ldd tipp10         \tdas Programm ist nicht dynamisch gelinkt   # (Program is not dynamic linked)          /usr/share/tipp10$ ./tipp10     bash: ./tipp10: File not found      Ubuntu 12.04 x64 What the heck is wrong here? **EDIT: --------------------- SOLUTION ---------------------** .. for those, who dont want to read the complete dup article. My OS is 64-bit. I though 32-bit apps would run on 64-bit machines. 32-bit apps can run on a 64-bit machine, but only if the requisite supporting libraries are installed. For running 32-bit programs, try installing the ia32-libs package.


Why is (free_space + used_space) != total_size in df?

> **Possible Duplicate:**   >  ext4: How to account for the filesystem space? I have a ~2TB ext4 USB external disk which is about half full:               $ df      Filesystem           1K-blocks      Used Available Use% Mounted on     /dev/sdc             1922860848 927384456 897800668  51% /media/big      I'm wondering why the total size (1922860848) isn't the same as Used+Available (1825185124)? From this answer I see that 5% of the disk might be reserved for root, but that would still only take the total used to 1921328166, which is still off. Is it related to some other filesystem overhead? In case it's relevant, `lsof -n | grep deleted` shows no deleted files on this disk, and there are no other filesystems mounted inside this one. Edit: As requested, here's the output of `tune2fs -l /dev/sdc`               tune2fs 1.41.14 (22-Dec-2010)     Filesystem volume name:   big     Last mounted on:          /media/big     Filesystem UUID:          5d9b9f5d-dae7-4221-9096-cbe7dd78924d     Filesystem magic number:  0xEF53     Filesystem revision #:    1 (dynamic)     Filesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize     Filesystem flags:         signed_directory_hash      Default mount options:    (none)     Filesystem state:         clean     Errors behavior:          Continue     Filesystem OS type:       Linux     Inode count:              122101760     Block count:              488378624     Reserved block count:     24418931     Free blocks:              480665205     Free inodes:              122101749     First block:              0     Block size:               4096     Fragment size:            4096     Reserved GDT blocks:      907     Blocks per group:         32768     Fragments per group:      32768     Inodes per group:         8192     Inode blocks per group:   512     Flex block group size:    16     Filesystem created:       Wed Nov 23 14:13:57 2011     Last mount time:          Wed Nov 23 14:14:24 2011     Last write time:          Wed Nov 23 14:14:24 2011     Mount count:              2     Maximum mount count:      20     Last checked:             Wed Nov 23 14:13:57 2011     Check interval:           15552000 (6 months)     Next check after:         Mon May 21 13:13:57 2012     Lifetime writes:          144 MB     Reserved blocks uid:      0 (user root)     Reserved blocks gid:      0 (group root)     First inode:              11     Inode size:           256     Required extra isize:     28     Desired extra isize:      28     Journal inode:            8     Default directory hash:   half_md4     Directory Hash Seed:      68e954e4-59b1-4f59-9434-6c636402c3db     Journal backup:           inode blocks


Is there something wrong with df output?

I'm using the command `df -h` to check disk usage on CentOS 6.4. I see an inconsistency with the output. ![df -h](http://i.stack.imgur.com/ft4pN.jpg) look at the line Filesystem: total 490Gb, used 55Gb, and Available 411Gb. What is it mean? I think that 490 - 55 = 435 ?


Is dash or some other shell "faster" than bash?

I always thought that the only benefit of using dash instead of bash was that dash was smaller, and therefore many instances of dash would start faster at boot time. But I have done some research, and found some people migrating all their scripts to dash in the hope they would run faster, and I also found this in the article DashAsBinSh in the Ubuntu Wiki: > The major reason to switch the default shell was _efficiency_. bash is an > excellent full-featured shell appropriate for interactive use; indeed, it is > still the default login shell. However, it is rather large and _slow to > start up **and operate**_ by comparison with dash. Nowadays I've been using lots of bash scripts for many things on my system, and my problem is that I have a particular script that I'm running continuously 24/7, that spawns around 200 children, which together heat my computer 10°C more than in normal usage. It is a rather large script with lots of bashisms, so porting them to POSIX or some other shell would be very time consuming (and POSIX doesn't really matter for personal use), but it would be worth if I could reduce some of this CPU usage. I know there are also other things to consider, like calling an external binary like `sed` for a simple bashism like `${foo/bar}`, or `grep` instead of `=~`. **TL;DR** is really bash slower to start up **and operate** in comparison with dash? Are there other Unix shells which are more _efficient_ than bash?


Filesystem writes seemingly lost

I've been experimenting with tcpdump, and I've found some very bizarre filesystem behavior. It doesn't look to be a tcpdump problem as I'll explain in a second. The following command produces no file:               tcpdump -w test.pcap      Yet this command produces the PCAP file as expected:               tcpdump -w - > test.pcap      At first I figured that tcpdump must be encountering some error when writing the file that the shell wasn't, so I straced and found that the writes were occurring just fine!               open("test.pcap", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 4      fstat(4, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0      mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff9bf5cb000     rt_sigaction(SIGUSR1, {0x4557d0, [], SA_RESTORER, 0x7ff9bea2ab60}, {SIG_DFL, [], 0}, 8) = 0      write(2, "tcpdump: ", 9tcpdump: )                = 9      write(2, "listening on eth0, link-type EN1"..., 73listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes) = 73     poll([{fd=3, events=POLLIN}], 1, 1000)  = 1 ([{fd=3, revents=POLLIN}])     poll([{fd=3, events=POLLIN}], 1, 1000)  = 1 ([{fd=3, revents=POLLIN}])     poll([{fd=3, events=POLLIN}], 1, 1000)  = 1 ([{fd=3, revents=POLLIN}])     write(4, "\324\303\262\241\2\0\4\0\0\0\0\0\0\0\0\0\377\377\0\0\1\0\0\0001\2\210P\34\3\3\0"..., 4096) = 4096     poll([{fd=3, events=POLLIN}], 1, 1000)  = 1 ([{fd=3, revents=POLLIN}])     poll([{fd=3, events=POLLIN}], 1, 1000)  = 1 ([{fd=3, revents=POLLIN}])     write(4, "\232\241\4\17X\213\f9+\225\35\t\364QF\223\242\7\217Y\226\373l\231vQ\354\223\250i\336."..., 4096) = 4096     poll([{fd=3, events=POLLIN}], 1, 1000)  = 1 ([{fd=3, revents=POLLIN}])     poll([{fd=3, events=POLLIN}], 1, 1000)  = 1 ([{fd=3, revents=POLLIN}])     write(4, "\34\226\346%\354\210\342\331\377\373\222d\261\0\5\207wX\6i`\0U\260\350\260\300\250\0\16\335\241"..., 4096) = 4096      test.pcap gets opened as file descriptor 4, and then several writes occur to that descriptor with the syscall reporting that the requested number of bytes was in fact written. Even so, no file is created. I scoured the filesystem for test.pcap and found nothing. What could produce this behavior?               tcpdump version 4.3.0     libpcap version 1.3.0     GNU bash, version 4.2.37(1)-release (x86_64-pc-linux-gnu)     Linux persephone 3.4.9-gentoo #1 SMP Wed Oct 3 10:02:39 EDT 2012 x86_64 Intel(R) Xeon(R) CPU E5645 @ 2.40GHz GenuineIntel GNU/Linux


TPS Based Shell Script

I am writing a shell script to test my soap web service's load handling. But I am not sure how to simulate the TPS value. Can you help me to find a way to handle that ?


How can I create a direct 8khz audio pipe in Ubuntu?

I'm interested in creating musical programs like these: http://www.youtube.com/watch?v=GtQdIYUtAHg&feature=player_embedded Essentially these programs just generate sequences of integers, which (apparently), when fed directly into a 8khz audio stream (like "/dev/audio"), produce interesting music. My problem is that my system does not have /dev/audio. In fact, looking through my /dev, it's unclear to me whether any of the devices is a direct audio interface. I have two questions:   1. Is there a nice package which will let me pipe in a stream of numbers from the command line, and produce a matching 8Khz audio output?   2. If not, how might I go about directly accessing my audio device?


How can I create a local function in my bashrc?

My .bashrc had some code that was repetitive so I used a function to simplify it               do_stuff() {       local version=$1       export FOO_${version}_X="17"       export FOO_${version}_Y="42"     }          do_stuff '5.1'     do_stuff '5.2'      However, now when I use my shell the "do_stuff" name is in scope so I can tab- complete and run that function (potentially messing up my environment variables). Is there a way to make "do_stuff" visible only inside the .bashrc?


Is data=journal safer for Ext4 as opposed to data=ordered?

The default journal mode for Ext4 is `data=ordered`, which, per the documentation, means that > "All data are forced directly out to the main file system prior to its > metadata being committed to the journal." However, there is also the `data=journal` option, which means that > "All data are committed into the journal prior to being written into the > main file system. Enabling this mode will disable delayed allocation and > O_DIRECT support." My understanding of this is that the `data=journal` mode will journal all data as well as metadata, which, on the face of it, appears to mean that this is the safest option in terms of data integrity and reliability, though maybe not so much for performance. Should I go with this option if reliability is of the utmost concern, but performance much less so? Are there any caveats to using this option? For background, the system in question is on a UPS and write caching is disabled on the drives.


How do I downgrade my nVidia Driver in openSUSE 12.1?

I'm trying to trouble-shoot a problem that I've been having. Downgrading my nVidia driver is about the only thing I haven't tried. I have an nVidea GeForce 6200 and installed the latest driver version 290.10, but Í'd like to try an earlier version. When I search for my driver on the nVidia website, it always brings me to the download page for the latest version. How can I find an _older_ version to install? Here's some potentially relevant information: **OS Information**               OS:                 Linux 3.1.0-1.2-default i686     System:             openSUSE 12.1 (i586)     KDE:                4.7.2 (4.7.2) "release 5"      **Display Info**               Vendor:             nVidia Corporation     Model:              GeForce 6200 (0x0221)     2D driver:          nvidia     3D driver:          NVIDIA 290.10      Please let me know if you need anything else.


Dual screen for plymouth with NVIDIA drivers

If I set plymouth to work with drivers the NVIDIA splash screen only appears on one monitor. While if I set it up with the nouveau driver appears on both monitors. Does anyone know how to configure plymouth with drivers NVIDIA to splash screen look at the two monitors?


Why are multiple command-line terminal consoles available/running at the same time on RHEL systems?

I'm studying for the RHCSA and am trying to wrap my mind around a seemingly basic concept: terminal consoles. I don't understand how/why RHEL systems make 6 terminal consoles (`/dev/tty _N_`) available for use. If I'm managing a server (or workstation for that matter), under what circumstances would I want to hop between terminals (e.g. `Ctrl`+`Alt`+`F2`)? Wouldn't I just be connected to one terminal and work from there?


Sum up the selected fields

I have a file with a numeric value in character positions 86 to 99. I want to sum up the entire amount present in the file, only for lines which contain `RS` at position 124-125. I am trying to do like `amt=$(cat custbills.cmp| cut -c124-125|grep 'RS'|cut -c86-99|awk '{s+=$1 } END {print s }')` and when i do `echo $amt` it is showing Zero. what is wrong in this. Fields in the file from 86 to 111 like `0000000016.65201406051101` In this `16.65` is amount. I have 300 records in this file. Sample data from 1 to 136 fields: `reportname 123456-78956 customername 0000000016.65201406051101 10RS 000000`


Moving linux install to a new computer

I know that it can, in some circumstances, be difficult to move a Windows installation from one computer to another (physically move the hard drive), but how does that work on linux? Aren't most of the driver modules loaded at bootup? So theoretically would it be that much of a hassle? Obviously xorg configs would change and proprietary ATI drivers and such would have to be recompiled (maybe?). Is there more to it than I'm thinking of? Assume the 2 computers are from the same era, ie both i7s but slightly different hardware. Update:   Thanks for the answers. This is mostly for my own curiosity. I have my linux system up and running at work, but eventually I'd like to move to a computer that I can get dual video cards into so I can run more than 2 monitors. But not any time soon


Getting new server. How do I move everything over?

> **Possible Duplicate:**   >  Moving linux install to a new computer A buddy of mine has found me a new server for our role-playing forums we run and my other web sites. I finally have my current server stable and running good though it is a bit slow (AMD 2400+ 2 GB RAM). I am running Ubuntu 11.4 (maybe?). I don't know what I am getting yet or if there are hard drives in the system. If there are no hard drives, can I just put my hard drive from the existing computer into the new one? If there is a hard drive (or RAID), what would be the best approach to migrate the server to the new one? I am running LAMP with WordPress, phpBB and couple other small web applications. I also have SVN running. That is basically it. I keep all software up-to-date.


Copying a working Linux instead of installing a new one

It is possible to move an installed Linux from one drive to another or from one disk to another by two methods:   1. `dd` command which copies sector by sector including boot sector   2. `cp` command, and then installing/updating `grub` These are very handy and easy methods, but I have no seen any instruction for using these methods for installing a new Linux on a new machine. Is there any disadvantage for this? For example, we can boot from a Live CD, and copy the files of a minimal installed Linux (without grub); then installing grub through `chroot`. In other words, we can have a minimal linux on a USB drive, and install it on any machine (by boot from it, copy itself, chroot, etc). The only things that should be altered (to my knowledge) is `grub` and `fstab` from on machine to another. Is there any disadvantage or drawback? NOTE: I know that Live CD installers somehow do a similar task, but I am curious if simple copying can cause problem on a new machine?


How to create a single page PDF file out of multiple EPS files with GhostScript

I'm trying to merge eps files into a pdf file using GS, however, I cannot get it to put multiple eps files without page breaks in between even if original files are small. The command I'm using is:               gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=out_file [list of eps files...]


Screen resolution problem in Fedora 17 on Oracle VirtualBox 4.2

I have HP Pavilion dv6 6119tx system which has a screen resolution of 1366X768. But after installing fedora 17 on VirtualBox with Guest additions, the default resolution is 1280X768. Whenever I switch to fullscreen mode, I have some black space left on both left and right sides of screen. Please help. Please also suggest me some resources to learn basics of Linux, commands in Linux(specifically Fedora 17).


Linux From Scratch 7.2: Error while making binutils-2.22 in chapter 6

I get the following error while executing `make tooldir=/usr`               ../../binutils-2.22/libiberty/regex.c:130:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]     ../../binutils-2.22/libiberty/regex.c:130:7: warning: conflicting types for built-in function 'malloc' [enabled by default]     ../../binutils-2.22/libiberty/regex.c:131:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]     ../../binutils-2.22/libiberty/regex.c:131:7: warning: conflicting types for built-in function 'realloc' [enabled by default]     In file included from /usr/include/bits/string2.h:1296:0,                  from /usr/include/string.h:633,                  from ../../binutils-2.22/libiberty/regex.c:149:     /usr/include/stdlib.h:470:14: error: conflicting types for 'malloc'     ../../binutils-2.22/libiberty/regex.c:130:7: note: previous declaration of 'malloc' was here     In file included from ../../binutils-2.22/libiberty/regex.c:638:0:     ../../binutils-2.22/libiberty/regex.c: In function 'byte_regex_compile':     ../../binutils-2.22/libiberty/regex.c:2439:7: warning: implicit declaration of function 'free' [-Wimplicit-function-declaration]     ../../binutils-2.22/libiberty/regex.c:2439:33: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]     ../../binutils-2.22/libiberty/regex.c:2500:17: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]     ../../binutils-2.22/libiberty/regex.c:2533:36: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]     ../../binutils-2.22/libiberty/regex.c:2640:28: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]     ../../binutils-2.22/libiberty/regex.c:3643:26: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]     ../../binutils-2.22/libiberty/regex.c:4150:5: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]     ../../binutils-2.22/libiberty/regex.c: In function 'byte_re_compile_fastmap':     ../../binutils-2.22/libiberty/regex.c:4835:11: warning: implicit declaration of function 'abort' [-Wimplicit-function-declaration]     ../../binutils-2.22/libiberty/regex.c:4835:11: warning: incompatible implicit declaration of built-in function 'abort' [enabled by default]     ../../binutils-2.22/libiberty/regex.c: In function 'byte_re_match_2_internal':     ../../binutils-2.22/libiberty/regex.c:7424:11: warning: incompatible implicit declaration of built-in function 'abort' [enabled by default]     ../../binutils-2.22/libiberty/regex.c: In function 'xregcomp':     ../../binutils-2.22/libiberty/regex.c:7978:4: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]     ../../binutils-2.22/libiberty/regex.c: In function 'xregexec':     ../../binutils-2.22/libiberty/regex.c:8053:7: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]     ../../binutils-2.22/libiberty/regex.c: In function 'xregerror':     ../../binutils-2.22/libiberty/regex.c:8081:5: warning: incompatible implicit declaration of built-in function 'abort' [enabled by default]     ../../binutils-2.22/libiberty/regex.c: In function 'xregfree':     ../../binutils-2.22/libiberty/regex.c:8114:3: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]     make[2]: *** [regex.o] Error 1     make[2]: Leaving directory `/sources/binutils-build/libiberty'     make[1]: *** [all-libiberty] Error 2     make[1]: Leaving directory `/sources/binutils-build'     make: *** [all] Error 2      The complete output is here, and the page I was using is here Can anyone help me? EDIT: `/usr/include/stdlib.h` (line 470)               extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;      `binutils-2.22/libiberty/regex.c` (line 130)               char *malloc ();


How to list namespaces in Linux?

Is there any method in Linux to list all namespaces on the running host? I need to check namespaces for particular processes (e.g. processes running in LXC-container and all other processes on the host) and then find out cgroups of them.


How to list keys added to ssh-agent with ssh-add?

How and where can I check what keys have been added with `ssh-add` to my `ssh- agent` ?


How to determine why my computer crashed?

Yesterday, I ran a `bash` script for about 10 hours. When I went to use the computer, it locked up.   * I have an Eee PC with Debian.   * The screen was still visible, but the mouse or keyboard had not effect.   * I tried `Ctrl``Alt``Delete`, `Ctrl``Alt``Backspace`, `Ctrl``Alt``F1`, but to no effect.   * The hard drive light showed no activity. How can I determine what went wrong? What logs can I check?


When can one reboot from inside a chroot environment?

Sometimes when I chroot into some folder , I could use `reboot` to reset my box, but sometimes I can't. So I want to know why I could do that sometimes and why. **UPDATE** The chroot environment is another Linux system installed on a different partition and I prepare the chroot as follows:               mount --bind /dev chroot/dev     mount --bind /sys chroot/sys     mount -t proc proc chroot/proc


How can I have my .bashrc only invoke TMUX if it exists on my system?

I use tmux on most boxes, but not all. I have the following line in my .bashrc file:               [ -z "$TMUX" ] && export TERM=xterm-256color && exec tmux      which invoke tmux if it exists. I _thought_ the `[ -z $TMUX ]` meant that it would only be used if tmux exists. However on another system, without tmux, I get -bash: exec: tmux: not found and the login attempt fails On my main system I see               $ echo $TMUX     /private/var/folders/ks/266xy5lj7x35gfj4csc66444b48rvq/T/tmux-373580663/default,55084,4      I also tried just `[ $TMUX ]` (i.e. no `-z`) but that didn't help I'm also looking for a robust solution that works in Ubuntu as well as OSX


How can I tell if lack of memory is causing these crashes?

I have a tornado web server running a flask application that connects to a postgres 9.3 database on an ubuntu 12.04 box. The application has been crashing intermittently and I am trying to understand why. The customer service for my cloud provider (digital ocean) says: > Many times, we see smaller sized droplets that run a full LAMP stack, run > out of memory due to the many processes that are running, that can cause > slow connections or services like Apache and MySQL crashing. How can I investigate this hypothesis? Is there a way to see how much memory is being used at different times on the server? Are there logs that might point to why the application is crashing?


What did `uniq -t` do?

I have some old code from 2003 which uses `-t` option for `uniq` command. It throws an error since that option is probably not supported anymore. Here's the piece which uses the command:               egrep -n "{ IA32_OP" ia32-decode.c | \         awk '{ print $1 $3 $4 }' | \         sort -t '(' +1 | \         uniq -t ':' -f 1 | \         sed 's/\(.*\)\:IA32_OP(\(.*\)),/#define IA32_OP_\2 \1/g' >> ia32_opcodes.h      What did that option do back then? What can I substitute that command with?


How to find system call implementations in Linux/Android 2.6.29?

> **Possible Duplicate:**   >  Understanding the Linux kernel source I want to modify some system calls for tracing purposes. To be specific, whenever a system call `open` is made, I want to print some messages. I have been looking into the internet and the code and I found `open.c` in `kernel/goldfish/fs/` directory. And there are many functions in this file. How would I know which function is being called exactly. I could have written some `printk` call in all these functions to find it but I have to do it for other system calls also. So, I have a few questions, 1) What is the best way to find implementation details of system calls? 2) I am using Kernel 2.6.29 (goldfish-Android). Are system calls implementation different in different kernel versions? 3) `strace` tells me that `msgget` ,`msgrecv` and 'SYS_24' system calls are being made. I look into `Android/bionic/libc/SYSCALLS.txt` file and msgget is not there. But when I look into `android/bionic/libc/kernel/arch-arm/asm/unistd.h` file, I can find `msgget` there. I can't understand what's going on and then how can I find implementation for `msgget` ? Thanks.


Linux source, where are sys_umount and sys_mount system calls?

> **Possible Duplicate:**   >  Understanding the linux kernel source I am **sure** that I must be missing something, here. I cannot for the life of me find the source code for these system calls. I can find their numbers, and I can find their prototypes, but I cannot seem to actually find the functions that implement them. In case anyone's interested: the reason that I am trying to find them is so that I can debug a problem with the kernel's floppy driver and/or my floppy drive itself. I can dd to/from it just fine. The drive works in DOS and Windows just fine. But when I mount a disk (any disk, doesn't matter what), the disk is mounted for approximately 1/10 of a second and then automatically unmounted. I am trying to find out why and if there is a way that I can patch my kernel locally to work around it. I know, I know, nobody uses floppies anymore. But I guess I am a nobody. :)


passwordless ssh for another username?

I want to do a passwordless ssh connection for a subversion project. Right now I'm using ssh+svn, and it's a little annoying, because I have to type the password any time I want to transact with the server. I've found several tutorials on the web about how to generate a key for passwordless ssh, but they all seem to assume that I'm using the same username on the remote system as I am for my home system. However, the username that I use for ssh+svn is different that the user account name on the system that I'm running. How do I set this up properly? I haven't had luck with just changing the name in the key file.


How to colorize text in emacs?

I want to view (and/or edit) colorized text in emacs, such as is output by `ls -l --color=always`, `tree...`, or whatever. The text I refer to exists in a file. When I open that file in emacs, I want to be able to see it colorized, or toggle it to show ANSI (SGR) escape sequences. `ansi-color.el` _seems_ be be what I need, but I haven't been able to get it to do any colorizing of the ANSi escape **sequences** , but I do see blue-bold for individual **contol bytes** (eg. `^A` and `^[`)... I'm not sure if that is a feature of `ansi-color`, but I think it is. According to the ansi-color.el comments, it can work with strings and regions, but even that doesn't seem to work.. For example the function `ansi-color- apply-on-region` is not recognized by `M-x`. It says, "No match" I've added `(require 'ansi-color)` to my _.emacs_ file and even `(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)`. I get no error or warning when emacs starts, so I'm stuck. How can I get the standard functions to work, and can it be made to automatically apply when opening a file whose name is suffixed with `.col`?


Linux distro to run a MIDI-server on a PII 333 MHz

I am looking for a Linux distro that can be used to redirect MIDI message from the network to the soundboard a TurtleBeach Montego from 1997. Currently the computer is running Windows 98 se and I get a total latency of 10 ms when feeding audio back through an analog cable. Since the computer has no display, I cannot do any remote control (other than shutdown, which I have added as ad- hoc messages). Full hardware list:   * Sound: TurtleBeach Montego   * Graphics: NVIDIA GeForce 6200 AGP   * CPU: Pentium II Deschutes 333 MHz   * RAM: 256 MB   * IDE controller The following is a list of requirements for the setup   * A total latency shorter or equal to 10 ms   * SSH   * ALSA   * Utility programs (ls, cp, ... ) Also, it would be nice to achive digital audio return through "what you hear" port without increased latency (on Windows 98 I cannot come below 40 ms if I do so). All distros seems to be too demanding for that machine. Do I need to configure my own? I do not need any GUI since it is just a server.


What does deb-src mean in the sources.list?

I know I can download binary packages from repositories beginning with "`deb`", but what does `deb-src` do? E.g.:               deb-src http://archive.ubuntu.com/ubuntu natty universe      in /etc/apt/sources.list in Ubuntu 11.04


How to list files that were changed in a certain range of time?

How can I list recursively all files that were changed between 22.12.2011 and 24.12.2011?


need to move files to different folder based on the creation date

I have set of files created from Monday to Friday..               a -- > 08/20     a1---> 08/21     a2---> 08/21     a3---> 08/21     a4---> 08/22     a5 --> 08/23      I need to move only 08/21 file to diffrenet folder. How is this possible ?


File extensions for unix shell scripts

On wikipedia, the article for .sh says: > For the .sh file extension type, see Bourne shell. How about other unix shells? I know that the shebang is used _inside the file_ to indicate an interpreter for execution, but I wonder:   * What are good practices for file extensions for unix shell scripts?    * Is it common for shell scripts to end with `.sh` **regardless** of which shell they run on?   * Are there any other commonly used file extensions for unix shell scripts?


Linux Ubuntu / Mint Live CD user-home customization

I'm trying to customize Linux Mint Live CD with these instruction (uck doesn't work for me). What I want is to have more icons at its Live CD user (`/home/mint/Desktop`) but I can't find `/home/mint` on the squashfs filesystem nor at the initrd fs. The changes I make in `/etc/skel` do not apply either. What am I missing? (I'm using a lxdm wm.)


How do I handle switches in a shell script?

Are there some built-in tools that will recognize `-x` and `\--xxxx` as switches, and not arguments, or do you have to go through all the input variables, test for dashes, and then parse the arguments thereafter?


What is the canonical way to implement order independent options in bash scripts?

> **Possible Duplicate:**   >  How do I handle switches in a shell script? Most common shell commands allow the user to specify options in any random order. Positional Parameters like `$1` as commonly used in bash (I tend to write all my scripts in Bash but I don't think this question is actually Bash specific) scripts on the other hand, are order specific. Now I could come up with _some_ way to remove the need for the user of a bash script to observe any particular order in the supplying of optional arguments. (Using regular expressions or globs to test for the presence of some particular option in the `$@` expansion comes to mind.) However, I am really trying to find out whether there is a particularly canonical way to implement such options. Given the common syntax for options like `-r` for many shell commands I certainly feel there should be.


How to code shell script with command line arguments like -la

> **Possible Duplicate:**   >  How do I handle switches in a shell script? I know how to deal with simple arguments $1-$9 but I don't know how to code it with such as `-la`, for example `ls -la`. Could you show me example?


using devtmpfs for /dev

I have noticed the following option in the kernel: CONFIG_DEVTMPFS               Device Drivers -> Generic Driver Options -> Maintain devtmpfs to mount at /dev      And I see that it is enabled by default in the Debian distribution kernel `3.2.0-4-amd64` I am trying to understand what difference this option brings. Without this option, `/dev` is mounded as `tmpfs` , with this option, it is moundet as `devtmpfs`. Other than that, I don't see any difference. The `help` did not clarify it for me either: > This creates a tmpfs/ramfs filesystem instance early at bootup. In this > filesystem, the kernel driver core maintains device nodes with their default > names and permissions for all registered devices with an assigned > major/minor number. > > It provides a fully functional /dev directory, where usually udev runs on > top, managing permissions and adding meaningful symlinks. > > In very limited environments, it may provide a sufficient functional /dev > without any further help. It also allows simple rescue systems, and reliably > handles dynamic major/minor numbers. Could somebody please explain the difference between using `CONFIG_DEVTMPFS` vs the standard `/dev`?


How can the job of SDFlasher.exe given with FriendlyARM utility be accomplished on Linux?

I am playing with **FriendlyARM Tiny 6410**. The instructions on setting up an SD card for booting self compiled versions of linux kernel involve the use of **SDFlasher.exe**. People have tried to find an alternative for Linux here http://www.friendlyarm.net/forum/topic/3295 in vain. I am sure that whatever the utility does can be accomplished using some simple commands on the terminal, provided we know what exactly it does. Can somebody help? The getting started instructions are available here - http://www.minidevs.com/Tiny6410/Bootloader.html#2_1_Create_the_SD_boot_card_39_45863506360910833


VIM(Mercurial) +python3.2 on debian wheezy: Could not load library function PySys_SetArgv

> ./configure --enable-python3interp=dynamic --enable-gui=gtk2     > --with-python3-config-dir=/usr/lib/python3.2/          make          vim --version|grep pyth              +cryptv          +linebreak       -python          +viminfo         -cscope          +lispindent      +python3/dyn     +vreplace      but if i do: :python3 print('hi') I get:               E448: Could not load library function PySys_SetArgv     E263: Sorry, this command is disabled, the Python library could not be loaded.


How to execute one command on all files within a folder

Saying, I have this tree and I want to execute `ruby` on all scripts within the folder. How could I archive through **one line of command**.               ./     ../     rb-script/         sample1.rb         sample2.rb


How to change the forgotten root password?

I am very new to Debian linux, I forgot my root password...actually I think I know what it is because it is the same password I have for pretty much everything but in the Terminal in tell me "Sorry, try again." Is there a way to reset the password? If so how? I am very new and I am not familiar with any type of command proms in the Terminal.


how to use syslog to avoid log file being garbled when multiple proceses are trying to write to the same log fille?

I wanted to know usage of syslog when multple processes are trying to write to the same log file like               for i in $var     do     some process >> logfile &     done     wait


Can Bumblee really help with Optimus Laptops?

I bought Lenovo Z570 which comes with nVidia GEForce GT520M (Optimus technology) and recently I installed Ubuntu 11.10. Surprisingly, whenever I boot my system CPU fan rotates at very high speed and so my battery backup is screwed up.I googled about this problem but I am not able to come to some conclusion. According to some vague sources, because of some bug, the Linux kernel is not able to support Optimus technology as of now. Does anyone have any solution for this problem?


How to detect a desktop application hanging

I want to write a script that will detect whether a particular desktop application is responding and kill it. Is this possible? I know I've seen the GNOME desktop put up a "Application is not responding" dialog, and I figure it sends some sort of signal to the window and waits a certain amount of time for a response. If there's a way to do something like that, I'd appreciate some details. Thank you! (This is on xfce, if it matters)


Which driver is handling my touchpad?

I would like to know how to determine which driver (out of those below) is handling my touchpad: appletouch.ko.gz, cyapa.ko.gz, sermouse.ko.gz, synaptics_usb.ko.gz, bcm5974.ko.gz, psmouse.ko.gz, synaptics_i2c.ko.gz, vsxxxaa.ko.gz


Get vertical cursor position

This might sound pretty weird, but I know how to set the vertical cursor position in Bash like this:               echo -e "\e[12H"      This moves the cursor to the 12th line (starting with 1). So how do I get the cursor position (line number) using linux bash? It would be helpful if I could simply store this value in a variable so I can calculate with it. **EDIT:** This is the error I get:               $ sh rowcol.sh     -en         read: 9: Illegal option -d                                   test.sh: 12: Bad substitution


host only ip address: can it be 10.*.*.*?

My router is set to have computers IP range from 10.1.1.1 to 10.1.1.60 I'm trying to run Linux in virtual box in a host computer with windows 7. The host computer has 10.1.1.5 currently, which is dynamic, set by DHCP on the router. The command, `ipconfig`, on the host computer shows the VirtualBox host only IP address 192.168.56.2 and Linux in it was well connected to the network. But later I changed the IP address of Linux as static 10.1.1.16 using `vim /etc/network/interfaces`. Then in the host computer's network configuration settings, I changed the IP address of VirtualBox as 10.1.1.16. Now my Linux is no longer connecting to the network. I'm new to this and am attempting to learn how these things work. Please help in showing me, what did I do wrong?


SMTP/POP server only for internal e-mails on hosted domain

We have a domain for a web site and e-mail that's hosted off-site. (We don't have a reliable enough connection to host it ourselves.) Our shared host sometimes has SMTP problems, but never POP problems. Is it possible to set up an e-mail server on CentOS 6.4 that will work internally (i.e. sending between e-mail addresses on our domain, even though our network domains are named differently than our web site) even if our Internet is down or our shared host's SMTP server is down, but will use our shared host's SMTP for outside addresses, and will still allow POP mail to be retrieved from the shared host, e.g. when we're at home or on the road?


Parsing a delimited text file in bash as command arguments

I have a text file split up like so:               field1,field2,field3      xield1,xield2,xield3      dield1,dield2,dield3      gield1,gield2,gield3      Each of these columns will be a parameter to a program, and I would like the program to be called for each line I was hoping for a loop, something like:               for $i in file         command $field2 -x $field3 -PN -$field1 >> output     done      What would be the best way to accomplish something like this in bash?


How can I revert a package to a specific version on Gentoo?

I'm a Debian user pretty much new to Gentoo. I wanted to install a specific version of a package namely the 1.39.0 version of dev-libs/boost, http://packages.gentoo.org/package/dev-libs/boost. But I already did "emerge dev-libs/boost" which installed me version 1.46.1-r1.               machine ~ # emerge --search boost     (...)     *  dev-libs/boost           Latest version available: 1.46.1-r1           Latest version installed: 1.46.1-r1           Size of files: 41,016 kB           Homepage:      http://www.boost.org/           Description:   Boost Libraries for C++           License:       Boost-1.0      How can I revert this package back to version 1.39.0? Thank you in advance.


How to enable printk selectively?

I want to print some statements from kernel but not all. So can I use printk selectively? By selectively I mean I want to enable printk only at particular places and disable it everywhere else. Right now I can only enable (in the kernel configuration enabling printk) or disable it globally; I have no choice at all.


Cross-compiling OpenSSH for Android

I'm working on compiling OpenSSH for Android based on this answer at Stack Overflow. Here's what I've done so far:   * Building on Ubuntu 14.04 amd64.   * `apt-get install build-essential gcc-arm-linux-androideabi` Download zlib, then do:               cd zlib-1.2.8     ./configure --prefix=/vagrant/build     make CC=arm-linux-androideabi-gcc     make install      This fails at the `make` step:               gcc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map -O3  -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -o libz.so.1.2.8 adler32.lo crc32.lo deflate.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo zutil.lo compress.lo uncompr.lo gzclose.lo gzlib.lo gzread.lo gzwrite.lo  -lc     /usr/bin/ld: crc32.lo: Relocations in generic ELF (EM: 40)     crc32.lo: error adding symbols: File in wrong format     collect2: error: ld returned 1 exit status     make: *** [libz.so.1.2.8] Error 1      What am I missing here? Is there something else it needs to know about to be able to build zlib? Next in the process is to build OpenSSL:               cd openssl-1.0.1h/     ./Configure dist --prefix=/vagrant/build/     make CC="arm-linux-androideabi-gcc" AR="arm-linux-androideabi-ar r" RANLIB="arm-linux-androideabi-ranlib"     make install      This again fails at the `make` step:               make[2]: Entering directory `/vagrant/openssl-1.0.1h/apps'     ( :; LIBDEPS="${LIBDEPS:--L.. -lssl  -L.. -lcrypto }"; LDCMD="${LDCMD:-cc}"; LDFLAGS="${LDFLAGS:--O}"; LIBPATH=`for x in $LIBDEPS; do echo $x; done | sed -e 's/^ *-L//;t' -e d | uniq`; LIBPATH=`echo $LIBPATH | sed -e 's/ /:/g'`; LD_LIBRARY_PATH=$LIBPATH:$LD_LIBRARY_PATH ${LDCMD} ${LDFLAGS} -o ${APPNAME:=openssl} openssl.o verify.o asn1pars.o req.o dgst.o dh.o dhparam.o enc.o passwd.o gendh.o errstr.o ca.o pkcs7.o crl2p7.o crl.o rsa.o rsautl.o dsa.o dsaparam.o ec.o ecparam.o x509.o genrsa.o gendsa.o genpkey.o s_server.o s_client.o speed.o s_time.o apps.o s_cb.o s_socket.o app_rand.o version.o sess_id.o ciphers.o nseq.o pkcs12.o pkcs8.o pkey.o pkeyparam.o pkeyutl.o spkac.o smime.o cms.o rand.o engine.o ocsp.o prime.o ts.o srp.o ${LIBDEPS} )     /usr/bin/ld: openssl.o: Relocations in generic ELF (EM: 40)     /usr/bin/ld: openssl.o: Relocations in generic ELF (EM: 40)     openssl.o: error adding symbols: File in wrong format     collect2: error: ld returned 1 exit status     make[2]: *** [link_app.] Error 1     make[2]: Leaving directory `/vagrant/openssl-1.0.1h/apps'     make[1]: *** [openssl] Error 2     make[1]: Leaving directory `/vagrant/openssl-1.0.1h/apps'     make: *** [build_apps] Error 1      Again it seems to be having the same problem, not being able to read a file that it wrote. I haven't made it to the final step of compiling OpenSSH yet, but this is how I assume that I'd do it:               cd openssh-6.6p1     ./configure --host=arm-linux --with-libs --with-zlib=$HOME/zlibArm --with-ssl-dir=$HOME/opensslArm --disable-etc-default-login CC=gcc-arm-linux-gnueabi-gcc AR=gcc-arm-linux-gnueabi-ar     make      Why is my compilation above failing for Zlib and OpenSSL when compiling for `arm-linux-androideabi`? How can I compile OpenSSH (specifically the client and the agent) for Android on ARM?


Is there a way to listen to process?

I want to know if there is a way to listen to a process in linux & unix - when it ends and what's the exit code of the process(script). I dont want to write a script that will run `X` seconds and check by `ps -ef | grep PID` if the process is still alive. I want to know if there is a way that the process will notify me when it ended and what was its exit code.


Find a file in lots of zip files (like find command for directories)

> **Possible Duplicate:**   >  Find recursively all archive files of diverse archive formats and search > them for file name patterns I need to search for a file in all zip files in a directory. Is there a tool like `find` that be able to search in ZIP files? I tried this:               find /path/ -iname '*.zip' -print -exec unzip -l {} \; |grep -i '<filename>'      But this only prints path of file in zip file and not the zip file name itself! Thanks


How to create a daemon which would be listening to dbus and fire script on message

I want to create a daemon, which would fire up a shell script in the background every time I unlock the screen on my ubuntu. I managed to create such script according to answer to related question: run-script-on-screen- lock-unlock. And it works well in terminal window. But now I want to create a daemon from that and I didn't get any luck yet.   Any suggestions?


Where can I find the source code of libgio?

I want to study how its GFileInfo components works.


Why VMware DHCP persists getting offline?

I am trying to set up a SSH server in my remote machine which is running Windows 7 on it currently. So first I set up a Oracle VirtualBox but it did not work for me properly. Then I decided to go with VMware instead of dealing with the problems of the VirtualBox. I installed VMware, installed an Ubuntu Virtual Machine inside. It is now working like a charm. But I have a problem. It gets disconnected after a while. As you can see below, it is disconnected. And it can get started to work properly again only if I switch manually to Vmnet8 and back to vmnet0 again. In the end (after performing the switching process) It takes a random Subnet address everytime it gets connected. My problem is I need to have always the same Subnet address everytime I get connected and set the system so that it never gets disconnected. So that I connect to the machine via SSH using putty without getting into settings and port forwarding processes and everything at everytime that I need to connect. ![Problem Screnshot](http://i.stack.imgur.com/RAIxc.png)


Should I change SSD?

Demsg shows this               EXT4-fs error (device sda1): ext4_ext_get_blocks: inode #7743113: (comm     flush-8:0) bad extent address iblock: 3503, depth: 1 pblock 0     EXT4-fs (sda1): delayed block allocation failed for inode 7743113 at logical     offset 3503 with max blocks 1 with error -5          This should not happen!!  Data will be lost     EXT4-fs error (device sda1): ext4_ext_get_blocks: inode #7743113: (comm     flush-8:0) bad extent address iblock: 3509, depth: 1 pblock 0     EXT4-fs (sda1): delayed block allocation failed for inode 7743113 at logical     offset 3509 with max blocks 2 with error -5          This should not happen!!  Data will be lost     EXT4-fs error (device sda1): ext4_ext_get_blocks: inode #7743113: (comm     flush-8:0) bad extent address iblock: 3513, depth: 1 pblock 0     EXT4-fs (sda1): delayed block allocation failed for inode 7743113 at logical     offset 3513 with max blocks 1 with error -5          This should not happen!!  Data will be lost     EXT4-fs error (device sda1): ext4_ext_get_blocks: inode #7743113: (comm     flush-8:0) bad extent address iblock: 3519, depth: 1 pblock 0     EXT4-fs (sda1): delayed block allocation failed for inode 7743113 at logical     offset 3519 with max blocks 1 with error -5          This should not happen!!  Data will be lost     EXT4-fs error (device sda1): ext4_ext_get_blocks: inode #7743113: (comm     flush-8:0) bad extent address iblock: 3525, depth: 1 pblock 0     EXT4-fs (sda1): delayed block allocation failed for inode 7743113 at logical     offset 3525 with max blocks 1 with error -5          This should not happen!!  Data will be lost     EXT4-fs error (device sda1): ext4_ext_get_blocks: inode #7743113: (comm     flush-8:0) bad extent address iblock: 3528, depth: 1 pblock 0     EXT4-fs (sda1): delayed block allocation failed for inode 7743113 at logical     offset 3528 with max blocks 1 with error -5          This should not happen!!  Data will be lost     possible SYN flooding on port 80. Sending cookies.     EXT4-fs error (device sda1): ext4_ext_get_blocks: inode #7743113: (comm     flush-8:0) bad extent address iblock: 3529, depth: 1 pblock 0     EXT4-fs (sda1): delayed block allocation failed for inode 7743113 at logical     offset 3529 with max blocks 3 with error -5          This should not happen!!  Data will be lost      Also I can't do a lot with the disk. Simple commands like fails               root@host [/home1]# rm -rf cprestore     rm: cannot remove     `cprestore/home4/site/public_html/hello/cache/site.com/http%3A%2F%2Fsite.com%2Fh%2F20019%2Fszh%2F%25E6%25B1%2589%25E5%258F%25A3%25E4%25B8%25AD%25E5%258D%258E%25E5%2585%25A8%25E5%259B%25BD%25E6%2580%25BB%25E5%25B7%25A5%25E4%25BC%259A%25E6%2597%25A7%25E5%259D%2580':     Input/output error     rm: cannot remove     `cprestore/home4/site/public_html/hello/cache/site.com/http%3A%2F%2Fsite.com%2Ft%2Ffoo%2Fszh%2F%25D7%25A7%25D7%2598%25D7%2592%25D7%2595%25D7%25A8%25D7%2599%25D7%2594%3A%25D7%2590%25D7%2595%25D7%25A0%25D7%2599%25D7%2595%25D7%25AA_%25D7%259E%25D7%25A2%25D7%25A4%25D7%2599%25D7%259C%25D7%2599%25D':     Input/output error     rm: cannot remove     `cprestore/home4/site/public_html/hello/cache/site.com/http%3A%2F%2Fsite.com%2Fp%2F%25E9%259F%25A9%25E6%2588%2590%25E7%258F%25A0%25E4%25B8%258D%25E9%259B%2585%25E8%25A7%2586%25E9%25A2%2591%25E5%25AE%258C%25E6%2595%25B4%25E7%2589%2588%2Fszh%2F1':     Input/output error      My fstab is like this:               #     # /etc/fstab     # Created by anaconda on Wed Nov  1 00:29:46 2000     #     # Accessible filesystems, by reference, are maintained under '/dev/disk'     # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info     #     UUID=9fac7ae7-9948-4612-88dc-e652fc4ceb73 /                       ext4    defaults        1 1     UUID=1daa52c7-a5da-464d-a4c7-2ee19ef017af /boot                   ext3    defaults        1 2     UUID=12649fb1-fd53-4558-8a2a-79692ada8b19 swap                    swap    defaults        0 0     tmpfs                   /dev/shm                tmpfs   defaults        0 0     devpts                  /dev/pts                devpts  gid=5,mode=620  0 0     sysfs                   /sys                    sysfs   defaults        0 0     proc                    /proc                   proc    defaults        0 0     /usr/tmpDSK             /tmp                    ext3    defaults,noauto        0 0     /dev/sda1               /home1                  auto    auto,noatime,defaults        0 2     /dev/sdb1               /home2                  auto    auto,noatime,defaults        0 2     /dev/sdc1               /home3                  auto    auto,noatime,defaults        0 2      As you see I check every reboot My provider said he did some fchk and now it's running again. However, it's been happening several time. Each time it happens it costs me a lot. I wonder if this is hardware or sotware?


Changing group and retaining environment variables

On campus, everyone's primary group is `user` and each person is additionally associated to groups depending on the courses he or she is taking, lab he or she works at, etc. My coworker and I are members of group `foo`, so we use `newgrp foo` and `umask 7` to ensure our files are accessible to the two of us without granting _everyone_ permission. Neither of us minded this. However, we now need our `PATH` environment variable to first point to our lab's `bin` folder before the rest in the `PATH`. We thought a simple script would work, but it doesn't as the `PATH`'s contents don't persist after executing `newgrp`:               #!/bin/tcsh     setenv PATH "/path/to/lab/bin:$PATH"     newgrp foo      The default shell is `tcsh`. Does anyone have any suggestions? Thanks!


My process was killed but I cannot understand the kernel notice

I have a custom application running on an embedded x86 setup (built using buildroot and uClibc). The application has been running fine but this morning when I returned to work I discovered my process had been killed and the following output on my terminal               SAK: killed process 1008 (CX_SC3): fd#4 opened to the tty     SAK: killed process 1009 (CX_SC3): fd#4 opened to the tty     SAK: killed process 1011 (CX_SC3): fd#4 opened to the tty     SAK: killed process 1012 (CX_SC3): fd#4 opened to the tty      Now `CX_SC3` is my process - it has multiple threads, one of which opens `/dev/ttyS0` to send messages over a radio modem. The fd number is 4 for the serial port. What I don't understand is   1. What the SAK means   2. The PID listed above must refer to a process that was killed by my application as there is only ever one instance of my application running at a time. Is it possible that these PIDs are actually my thread IDs (as my application does run 4 threads always).   3. If my application killed other processes, why was my application also killed?   4. What does the `opened to the tty` part mean? From some research this suggests that this has something to do with a interrupt character sent to the tty that I used to start the program.  I am sure that the above is pretty obvious when you are a linux guru but I am struggling - can anyone suggest what events could have lead to the following output? My embedded setup is very small, uses `busybox` and runs `vsftpd` and very little else other than my custom application. It is vital that my application is robust so if anyone can suggest/guess as to what sequence of events could have caused the above I will be very grateful. **EDIT:** In response to the comment below, if this is due to a SAK being detected, is there anything that can accidentally trigger this? Is it possible that anything being read on the serial port has triggered this? Also, how can I find the SAK combination for my system - I do not have a `rc.sysinit` or `rc.local` file anywhere in my root file system. **UPDATE:** I have managed to pin this event down to the point at which my host machine shuts down. I have a serial cable between my host machine and my target device which I use to send serial data to the embedded target. When I leave the target running, but shutdown the host, my application is killed as described above. When I disconnect the serial cable prior to shutting down my host machine then my application does not get killed and runs as normal. This behaviour happens even after I have performed               echo 0 > /proc/sys/kernel/sysrq      as advised.


Could Autorun Virus, affect my PC via Wine?

I have installed wine and I am afraid that viruses will affect my PC now. I will not open any other .exe file other than mine one (which I use everyday)