I wish to copy the top 1000 lines in a text file containing more than 50 million entries, to another new file, and also delete these lines from the original file.
Is there some way to do the same with a single shell command in Unix?
...
How do I find all the files that were create only today and not in 24 hour period in unix/linux
...
what does the regular expression $$ evaluate to?
...
Hi,
I need to find the encoding of all files that are placed in a directory. Is there a way to find the encoding used?
The file command is not able to do this.
The encoding that is of interest to me is:ISO-8859-1. If the encoding is anythign else i want to move the file to another directory.
Appreciate any assistance,
Thanks,
Manglu...
Hi,
I have a long running process and I need it to launch another process (that will run for a good while too). I need to only start it, and then completely forget about it.
I managed to do what I needed by scooping some code from the Programming Ruby book, but I'd like to find the best/right way, and understand what is going on. Here'...
I have a long URL on a web page in Windows that I need to copy into bash shell in Unix. Is there a way to do this without retyping the URL?
...
I have a directory containing multiple subdirectories. I want to list only those subdirectories that contain at least one file. How can I do that?
...
In the bash command line, I set a variable myPath=/home/user/dir . I created a script in which I put echo $myPath but it doesnt seem to work. It echoes nothing. What can I do to access the myPath variable in the script. If I write echo $myPath in the command, it works, but not in the script.
...
I have multiple files in a folder and each of them have one email message. Each message has a header in the format
Subject: formatting fonts
To: [email protected]
From: sender name
message body
I want to get all the unique sender names from all the messages (there is only 1 message per file) . How can I do that?
...
I want to use space as a delimiter with the cut command. What would be the syntax?
...
In a unix shell, if I want to combine stderr and stdout into the stdout stream for further manipulation, I can append the following on the end of my command:
2>&1
So, if I want to use "head" on the output from g++, I can do something like this:
g++ lots_of_errors 2>&1 | head
so I can see only the first few errors.
I always have t...
I know this will delete everything in a subdirectory and below it:
rm -rf <subdir-name>
But how do you delete everything in the current directory as well as every subdirectory below it and the contents of all of those subdirectories?
...
I have a Bash shell script that invokes a number of commands.
I would like to have the shell script automatically exit with a return value of 1 if any of the commands return a non-zero value.
Is this possible without explicitly checking the result of each command?
e.g.
dosomething1
if [[ $? -ne 0 ]]; then
exit 1
fi
dosomething...
POSIX.1e was going to define ACL (Access Control List) mechanisms for POSIX (amongst other security-related issues), but the proposals were never converted to a formal standard. Nevertheless, ACLs (not necessarily POSIX.1e ACLs) are supported at least optionally in all the main variants of Unix (Linux, BSD, MacOS X(ACL), HP-UX, AIX (p10...
On SunOS there is pargs command that prints the command line aruguments passed to the running process.
Is there is any similar command on other Unix environments?
...
I was wondering if there are any small BSD or unix releases. The smallest Linux release I've seen that looked good is partedmagic (around 70MB). Free BSD needs like 4 CDs, maybe more.
...
The "disown" command works in bash, but not in ksh.
If I have started a process in ksh, how can I "disown" it, so I can exit my shell.
(I know about nohup, but the process has already started!)
...
Do you know if there is a UNIX command that will tell me what the CPU configuration for my Sun OS UNIX machine is? I am also trying to determine the memory configuration. Is there a UNIX command that will tell me that?
...
If I want to allocate a char array (in C) that is guaranteed to be large enough to hold any valid absolute path+filename, how big does it need to be.
On Win32, there is the MAX_PATH define. What is the equivalent for Unix/linux?
...
I would love to install python2.5 on sco unix, and am wondering anybody who has attempted to do this?
...