Hi All,
I want to create a command that executes a text editor with the most recent file in the current current directory.
So a good start to achieve this is :
ls -lrt | cut -c55- | tail -1
which provides the name of the most recent file in a directory
The problem is to pipe the... (4 Replies)
current dir :
/home/sales
ls -l
abc.txt 17th aug
bcd .txt 16t oct
-------
------
Total files : 100
if i want to move only those files dated 17 aug into another sub directory /home/sales/texas
how do i pipe the result of 'ls' command to a 'mv' command (1 Reply)
Hi My friends
I have used this command to find files are modified within the past 24 hours
and then many files are shown but I want transfer all these files to special directory by using pipe .
can any one tell me what is the next step ? (11 Replies)
Hi,
Can't you have a pipe in a command string ?
If I try the following I get errors.
Why ?
> cmd="ls -lrt | grep xyz"
> $cmd
|: No such file or directory
grep: No such file or directory
xyx: No such file or directory
Thanks in advance
Hench (3 Replies)
I am pretty new to UNIX. My client has a requirement where in a directory we have some files with somewhat similar name
like test_XX.txt, test_XY.txt, test_XZ.txt, test_ZZ.txt, test_ZY.txt, test_ZX.txt, test_YY.txt......Out of these files
few files have 0 bytes. Is there a way where we can go... (7 Replies)
Hi all,
Can someone help me with the following problem.
I am executing the following command:
(search for occurences of 'error' in files that match cl-*.log expression)
> grep -cw -i --max-count=1 'error' cl-*.log
this command outputs:
cl-apache.log:1
cl-apache_error.log:1... (3 Replies)
Single command to ls all the files inside a particular directory hierachy and output this to a file and open this in a vim file so that i can use gf command in vim to browse through all the files inside this hierachy.
eg :
dir1/dir2
and
dir1/dir3
dir2 and dir3 contain the files i need... (7 Replies)
Hello to all,
Having a ruby script that works when an argument is given in command line in this way:
ruby script.rb input_to_ruby
To accept arguments as input, inside the ruby script has
File.open(ARGV)
input_to_ruby is generated by another command, so I need to create first input_to_ruby... (6 Replies)
Hi again, have a script that I would like run, but before I can run it I need to strip out the windows \r end of lines.
I have put the command into a text file and set the command to run every 10 seconds the coomand I use to do this is
while sleep 10; do... (15 Replies)
Discussion started by: Paul Walker
15 Replies
LEARN ABOUT LINUX
rbash
RBASH(1) General Commands Manual RBASH(1)NAME
rbash - restricted bash, see bash(1)RESTRICTED SHELL
If bash is started with the name rbash, or the -r option is supplied at invocation, the shell becomes restricted. A restricted shell is
used to set up an environment more controlled than the standard shell. It behaves identically to bash with the exception that the follow-
ing are disallowed or not performed:
o changing directories with cd
o setting or unsetting the values of SHELL, PATH, ENV, or BASH_ENV
o specifying command names containing /
o specifying a file name containing a / as an argument to the . builtin command
o specifying a filename containing a slash as an argument to the -p option to the hash builtin command
o importing function definitions from the shell environment at startup
o parsing the value of SHELLOPTS from the shell environment at startup
o redirecting output using the >, >|, <>, >&, &>, and >> redirection operators
o using the exec builtin command to replace the shell with another command
o adding or deleting builtin commands with the -f and -d options to the enable builtin command
o using the enable builtin command to enable disabled shell builtins
o specifying the -p option to the command builtin command
o turning off restricted mode with set +r or set +o restricted.
These restrictions are enforced after any startup files are read.
When a command that is found to be a shell script is executed, rbash turns off any restrictions in the shell spawned to execute the script.
SEE ALSO bash(1)GNU Bash-4.0 2004 Apr 20 RBASH(1)