Tag Info

Hot answers tagged

10

If you have root permissions on that machine you can temporarily increase the "maximum number of open file descriptors" limit: ulimit -Hn 10240 # The hard limit ulimit -Sn 10240 # The soft limit And then paste res.* >final.res After that you can set it back to the original values. A second solution, if you cannot change the limit: for f in ...


8

If chaos' answer isn't applicable (because you don't have the required permissions), you can batch up the paste calls as follows: ls -1 res.* | split -l 1000 -d - lists for list in lists*; do paste $(cat $list) > merge${list##lists}; done paste merge* > final.res This lists the files 1000 at a time in files named lists00, lists01 etc., then pastes ...


6

Whatever you're saying about ~$, home$, and /home$ doesn't make much sense.  I guess you're talking about your command line prompt; if so, it would have been useful to show what you typed and what happened (and then explained what you expected). But I can read minds, so I believe that I understand the issue: ~ and ~user239887 (assuming user239887 is your ...


5

This is called typeahead, and it's not shell specific. What you type ends up being buffered in the terminal, and the next time a program running in the terminal is ready for input it reads what is waiting in the buffer. In your example that program is the shell, so it executes the command you typed as if you'd waited for A to finish before typing it. Some ...


3

In your script file named hexto64, simply write : #!/bin/bash printf "%s" "$1" | xxd -r -p | base64 And then you can use it as such : hexto64 49276d2 Just so you know, $1 means the first parameter you gave after the program name : 49276d2 in our case.


3

What you need isn't an alias, but a function. Aliases do not support parameters in the way you want to. It would end just appending the files, gtkmm simple.cc simple would end like: g++ -o `pkg-config gtkmm-3.0 --cflags --libs` simple.cc simple and that's not what you try to achieve. Instead a function allows you to: function gtkmm () { g++ "$1" -o ...


2

You can use find to only select the `.txt files from under some directory: find direct/direct? -name "*.txt" this would print out all the files, so you can check you got what you wanted, and not too much is going to be selected. The *.txt has to be quoted, otherwise the shell will try expand this to .txt files in the current directory. As for the ...


2

As stated by jpkotta, network-manager is likely the culprit. You can see its status by running ps -aux | grep network-manager | grep <username>. If you get a result, it is running, otherwise it isn't. It will keep overwriting any changes you make with ifconfig as long as it is running. Kill network-manager by running sudo service network-manager ...


2

Try to execute it on this way: ls res.*|xargs paste >final.res You can also split the batch in parts and try something like: paste `echo res.{1..100}` >final.100 paste `echo res.{101..200}` >final.200 ... and at the end combine final files paste final.* >final.res


2

From man ls: -a, --all do not ignore entries starting with . -F, --classify append indicator (one of */=>@|) to entries -h, --human-readable with -l, print sizes in human readable format (e.g., 1K 234M 2G) -l use a long listing format The command ls -alhF is equivalent to ls -a -l -h -F The ability to ...


2

It sounds like what you are describing is actually program A running in the background. A process can still print to the terminal even if it is running in the background. A bash example: #----background_program----# #!/bin/bash for ((i=0;i<=10;i++)); do echo "$i" sleep 5 done exit 0 You can run this in the background, see its output popping ...


2

In shell, user's home directory is located in /home/username, ~ is shortcut for home directory of the current user using the shell, ~usr is shortcut for home directory of user with username usr, so ~usr is the same as /home/usr. If your username is usr, then ~ and ~usr are the same. The home directory of current user is also saved in variable $HOME.


2

i=0 { paste res.? res.?? res.??? while paste ./res."$((i+=1))"[0-9][0-9][0-9] do :; done; } >outfile I don't think this is as complicated as all that - you've already done the hard work by ordering the filenames. Just don't open all of them at the same time, is all. Another way: pst() if shift "$1" then paste "$@" fi set ...


1

Given the amount of files, line sizes, etc. involved, I think it will surpasses the default sizes of the tools (awk, sed, paste, *, etc) I would create a small program for this, it would not have 10,000 files open, nor a line of hundred of thousands in length (10,000 files of 10 (max size of line in the example)). It only requires an ~10,000 array of ...


1

The $HOME environment variable is commonly set and exported by login to the pathname of a user's home directory when a user logs in. A POSIX-compatible shell will use the value of this environment variable in a context when it should perform a ~ tilde expansion to complete a path to a username's home directory but the actual expanded field is otherwise null. ...


1

Answer: @derobert pointed out the "sox" and "play" command are part of the same package but does different thing. The 3600 below is the time interval in seconds. sox -n note.mp3 synth 3600 sin 347 The above code will generate an hour long tone without playing it. play -n note.mp3 synth 3600 sin 347 The above code will play the tone for an hour AND ...


1

If you want to copy all the .txt files in a directory, use a wildcard pattern: cp direct/direct1/*.txt target This copies all the .txt files that are in the directory direct/direct1 to the directory target (which must already exist). You can pass multiple patterns to copy files from multiple directories: cp direct/direct1/*.txt direct/direct2/*.txt ...



Only top voted, non community-wiki answers of a minimum length are eligible