If you just want to copy regular files from /tmp to /home/jail/tmp, one could try something like:
Code:
for path in /tmp/*
do [ -f "$path" ] && cp -p "$path" /home/jail/tmp
done
assuming that you're using a shell based on Bourne shell syntax.
Hi Don Cragun and thanks for your concern,
No I only want to copy the directory and its attributes, not the files nor the other folders in it.
------ Post updated at 15:15 ------
Quote:
Originally Posted by jim mcnamara
Code:
# a root user
mkdir /home/jail/
mkdir /home/jail/tmp
chmod 7777 /home/jail/tmp # set sticky bit
Try this?
Hi jim mcnamara and thanks for your interest,
That technic would fail to copy any folder with nod other than 7777.
It would fail to copy /etc/sudoers.d to /home/jail/etc/sudoers.d and also fail to copy /var/run to /home/jail/var/run
What I want is to copy a folder and its attributes and nothing else.
I'm looking for a command that does what this script does:
I have the below code to recurse through a given file path. I am able to go to the leaf level once recursively but traversing out is not possible as the required varaibles don't have the values on return. Both typeset and local don't work for my variable definitions. I have the o/p of the sample... (2 Replies)
I faced a problem when I tried to copy files from one directory to another using certain user although this user has r/w/x permission on source and destination directory ?? the OS is Linux-Suse 9
any help?? (2 Replies)
Hi,
I have a folder that has about 100 directories. They all have different names. I need to do a find and copy of only directories (and their files) that start with ABC.
There are directory names as ABCDE,ABCDG,ABCHT and so on.
I tried using the AB* but that doesn't work. Can someone... (4 Replies)
Hi,
I have to copy last modified Directory to another directory.How can i Do using pipe or redirect
cp -R 'ls -lrt|tail -1' test is not working.
please help. (3 Replies)
Dear All,
Again I have another simple question. :confused:
I want to write a csh which can copy all files of a current directory with a new name in the same directory, I mean:
If I have tree bird apple as files in a directory I want to give ,say number 007 as argument to my csh and it copies... (3 Replies)
Hi experts
cp bin root src /mnt
but not copy bin/bigfile
any help?
( I post this thread in the "redhat" forum wrongly, I don't know how to withdraw that question in that wrong forum)
Thanks (6 Replies)
How to copy files from one directory to another directory with the subfolders copied.
If i have folder1/sub1/sub2/* it needs to copy files to folder2/sub1/sub2/*.
I do not want to create sub folders in folder2.
Can copy command create them automatically?
I tried cp -a and cp -R but did... (4 Replies)
Hi guys,
I need a solution to copy files and folders without using cp-r , cp-R or any variants. So i need to code it manually. I allready have a loop
#!bin/bash
IFS=$'\n'
if test "$1" = ""
then
wd=pwd
else
wd=$1
fi
for file in $(find $1)
do
if... (1 Reply)
Hope the title is close enough; didn't quite know how to put this...
OK.
We have a hypothetical script, script.a, with one simplistic line:bash ./nextDir/script.bNow script.b has a bit more going for it; and does file moves, copies, and renames, calling all the targets with respect to itself.... (7 Replies)
Discussion started by: LinQ
7 Replies
LEARN ABOUT FREEBSD
jls
JLS(8) BSD System Manager's Manual JLS(8)NAME
jls -- list jails
SYNOPSIS
jls [-dhNnqsv] [-j jail] [parameter ...]
DESCRIPTION
The jls utility lists all active jails, or the specified jail. Each jail is represented by one row which contains space-separated values of
the listed parameters, including the pseudo-parameter all which will show all available jail parameters. A list of available parameters can
be retrieved via ``sysctl -d security.jail.param''. See jail(8) for a description of some core parameters.
If no parameters or any of the options -hns are given, the following four columns will be printed: jail identifier (jid), IP address
(ip4.addr), hostname (host.hostname), and path (path).
The following options are available:
-d List dying as well as active jails.
-h Print a header line containing the parameters listed. If no parameters are given on the command line, all is assumed.
-N In the standard display mode, print each jail's name instead of its numeric ID. If the jail does not have a name, the numeric ID is
printed instead.
-n Print parameters in ``name=value'' format, where each parameter is preceded by its name. If no parameters are given on the command
line, all is assumed.
-q Put quotes around parameters if they contain spaces or quotes, or are the empty string.
-s Print parameters suitable for passing to jail(8), skipping read-only and unused parameters. Implies -nq.
-v Print a multiple-line summary per jail, with the following parameters: jail identifier (jid), hostname (host.hostname), path (path),
jail name (name), jail state (dying), cpuset ID (cpuset), IP address(es) (ip4.addr and ip6.addr).
-j jail
The jid or name of the jail to list. Without this option, all active jails will be listed.
SEE ALSO jail_get(2), jail(8), jexec(8)HISTORY
The jls utility was added in FreeBSD 5.1. Extensible jail parameters were introduced in FreeBSD 8.0.
BSD July 20, 2012 BSD