How to list hidden files in a directory with "ls" bash command?
I'm in the top visible directory of an iPod "IPOD (ADMIN" and I want to see the iTunes folder. How can I see the hidden folders? Alternatively is there a flag I can swtich to make them visible just inside the terminal application. I found a terminal command to do it in the Finder after you do a forced reboot.
FWIW. if these are not dot files or folders and they are hidden from finder view, you can do one of the following to make them finder visible:
chflags nohidden file-or-folder
Or if you have the developer tools installed:
/Developer/Tools/SetFile -a v file-or-folder
Use this technique instead of the finder option to make all hiden files visible.
Similar Messages
-
How to list the files in a directory which are recently modififed few mins
Hi,
I need command to list the files in a directory which are modified few minutes ago in SunOS. like "find . -cmin 2 -print " which list files that are modified 2 mins ago in Linux platform.
Thanks in advance.
sudha85The find command that comes with solaris doesnt have the cmin operator. Only mtime whose option is days.
So install gnu find from sunfreeware which is the same one that comes with linux. -
How to list specific files in a directory
Hi. I have a FilanemeFilter derived class which works fine. The problem I have is how do I list the files in the subdirectory of the current directory?
I wrote sth like this but it doesn't work:
File dir = new File( File.separator + "components");What am I doing wrong?Well, I know it doesn't work becouse I used the JFileChooser to check this out. I gave it as a constructor parameter. According to the docs if the given dir doesn't exist the JFileChooser opens the system default drectory, which under Windows happens to be MyDocuments folder. That's how I know.
-
How to list all files and directories in another directory
I need to be able to list all the directories and files in a directory. I need to write a servlet that allows me to create an html page that has a list of files in that directory and also list all the directories. That list of files will be put into an applet tag as a parameter for an applet that I have already written. I am assuming that reading directories/files recursively on a web server will be the same as reading directories/files on a local system, but I don't know how to do that either.
Hi,
Here is a method to rotate through a directory and put all the files into a Vector (files).
* Iterates throught the files in the root file / directory that is passed
* as a parameter. The files are loaded into a <code>Vector</code> for
* processing later.
* @param file the root directory or the file
* that you wish to have inspected.
public void loadFiles(File file) {
if (file.isDirectory()) {
File[] entry= file.listFiles();
for (int i= 0; i < entry.length; i++) {
if (entry.isFile()) {
//Add the file to the list
files.add(entry[i]);
} else {
if (entry[i].isDirectory()) {
//Iterate over the entries again
loadFiles(entry[i]);
} else {
if (file.isFile()) {
//Add the file
files.add(file);
See ya
Michael -
Is there a way that you can get a list of files in a directory that are spelt a certain way? Ex. If in a directory there are html files, txt files, et, In java can I get *.html or a html file with certain text in the name? java.html??
How you can Help
US101here are the code to list your files
File startDir = new File("your directory goes here" );
File[] dirList = startDir.listFiles();
if (startDir.isDirectory());
out.print( startDir.getPath() );
//Start cycling through the array for the file
for ( int count = 0; count < dirList.length; count++ )
String fileName = dirList[count].getName();
int index = fileName.lastIndexOf('.');
String newString = null;
if (index >= 0)
newString = fileName.substring(index, fileName.length());
if ( newString.equalsIgnoreCase( ".txt"))
if ( dirList[count].isDirectory())
out.println( dirList[count].getName() );
else
out.println( dirList[count].getName());
}//end else
}// end if newstring
}//end if index
}//end for -
List all files in a directory, not including the sub directories if any
Hi,
I have been looking around php.net for a bit and can not work
out how i list the files that are in a directory i.e.
www.site.com/directory/
I would like the names of each file to be placed in an array,
but not to have the sub directories in this list should there be
any.
I was given some code a while ago that done this but it
listed the sub directories and i would like them not in this list.
I do not have this code anymore and do not know where i got
it, so i can not get it amended to what i need.
please can someone tell me what line of code i should be
using.
thank you in advance for your help.(_seb_) wrote:
> not very clever wrote:
>> Hi,
>>
>> I have been looking around php.net for a bit and can
not work out how
>> i list the files that are in a directory i.e.
>>
>> www.site.com/directory/
>>
>> I would like the names of each file to be placed in
an array, but not
>> to have the sub directories in this list should
there be any.
>>
>> I was given some code a while ago that done this but
it listed the
>> sub directories and i would like them not in this
list.
>>
>> I do not have this code anymore and do not know
where i got it, so i
>> can not get it amended to what i need.
>>
>> please can someone tell me what line of code i
should be using.
>>
>> thank you in advance for your help.
>>
>>
>>
>
> The follwoing PHP code will do just that. Just replace
"pathToFolder"
> with the path to your folder.
> I made the list of files also link to each file. Just
remove the link
> echo if you don't them to be links.
>
> <?php
> // FUNCTION TO LIST FILES:
> function listFiles($path){
> if($handle = opendir($path)){
> while(false !== ($file = readdir($handle))){
> if (is_file($path.'/'.$file) &&
!preg_match('/^\./',$file)){
> $files_array[]=$file;
> }
> }
> }
> return($files_array);
> }
> $path = 'pathToFolder';
>
> // CALL THE FUNCTION:
> $files_array = listFiles($path);
> foreach($files_array as $file){
> echo '<p><a
href="'.$path.'/'.$file.'">'.$file,'</a></p>';
> }
>
> ?>
>
I spotted one error:
foreach($files_array as $file){
echo '<p><a
href="'.$path.'/'.$file.'">'.$file,'</a></p>';
should be:
foreach($files_array as $file){
echo '<p><a
href="'.$path.'/'.$file.'">'.$file.'</a></p>';
(a dot after $file, not a coma)
seb ( [email protected])
http://webtrans1.com | high-end web
design
Downloads: Slide Show, Directory Browser, Mailing List -
Anyone knows how to delete a file from a directory?????
hi there
anyone has any idea on how to delete a file from a directory? delete(String filename)? thank you.Hi,
Check this link.
Gives you an example code to show how to delete a file.
http://examples.oreilly.com/jenut/Delete.java
Hope this helps.
Roopasri Vittal
Developer Technical Support
Sun Microsystems
http://sun.com/developers/support -
How to create a file in current directory
hi,
I want to create a file in a current directory, But when i written following
code then it cannot create file, How i will create file in current directory?
Is there anyone who can help me?what will be the solution of this problem?
Please give me solution
String dir=application.getRealPath("/");
int count;
String filename="sample.txt";
out.println(dir+filename);
FileOutputStream fout=new FileOutputStream(filename);
PrintStream p;
p=new PrintStream(fout);
p.print("1");
p.close();with regards
Binahi,
my problem is that my path is ok...but when i open file in this directory then
it cannot open a file, is there anyone who can do it? When a user save data in server from remote
area then what will be path of my code? how i will solve it? please give me
solution.
with regards
bina -
HOW TO VIEW HIDDEN FILES?????
i have searched for days on my computer for some hint a program or option that allows me to view any hidden files in an application folder, but it has yet eluded me.
I am having trouble with a program of mine, and the tech service there told me to send them the programs log file, which they named. i looked in the applications folder, and the only files i saw was the program icon, and the uninstall folder, which contained the uninstall icon. i told them this, and they replied:
"i'am sure that these files are on your computer. Maybe they are invisible.
Please search (automatic) the folder ".********" ."
if anyone knows, eitehr what this means, or how to view hidden files, please let me know
ThanxTo see inside an application package select the application then CTRL- or RIGHT-click and select Show package contents from the contextual menu. You can navigate through the application package's content. It's unlikely you will find anything useful there.
To see invisible files open the Terminal application in your Utilities folder and at the command line prompt enter or paste the following command then press RETURN:
defaults write com.apple.finder AppleShowAllFiles TRUE
To turn off the display of invisible files substitute FALSE for TRUE in the same command line.
Invisible files are invisible for a reason - to hide them from the prying eyes of novice users and ignorant tech support people. Perhaps it would be more helpful if you could detail the problem you are having. -
How to create pdf files in UNIX directory from oracle reports
I would like to know how to create pdf files in UNIX directory from oracle reports.
Thanks,Please make your question more clear . Also mention the reports version.
1) If you are runnning reports in Unix, you can give
.... destype=file desformat=pdf desname=<filename>
in command line
Please refer docs below.
2) If by your question you mean
"My reports server is running in Windows but I want to ftp my files to Unix after creating it"
then the answer is that you can use pluggable destination "ftp"
.... destype=ftp desformat=pdf desname=<ftp url>
Pluggable destinations download
http://otn.oracle.com/products/reports/pluginxchange/index.html
Thanks
Ratheesh
[ All Docs ]
http://otn.oracle.com/documentation/reports.html
[ Publishing reports to web - 10G ]
http://download.oracle.com/docs/html/B10314_01/toc.htm (html)
http://download.oracle.com/docs/pdf/B10314_01.pdf (pdf)
[ Building reports - 10G ]
http://download.oracle.com/docs/pdf/B10602_01.pdf (pdf)
http://download.oracle.com/docs/html/B10602_01/toc.htm (html)
[ Forms Reports Integration whitepaper 9i ]
http://otn.oracle.com/products/forms/pdf/frm9isrw9i.pdf -
How to see hidden files in folder, how to see hidden files in folder
how to see hidden files in folders
Welcome to Apple Support Communities
You can't see by default hidden files through Finder. However, you can do it with a command that you can copy in Terminal (in /Applications/Utilities). Open this application and type:
defaults write com.apple.finder AppleShowAllFiles TRUE && killall Finder
After doing it, you will be able to see hidden files through Finder in all the volumes connected to the MacBook Pro -
List all files in a directory on a server that hosts the applet
Hei :)
I have a problem. I want to list all files in a directory on my server. ( http://www.foo.bar/tw )
The applet is in the root folder ( http://www.foo.bar ).
So i tried it like this
File fi = new URL(getCodeBase() + "/all/").getFile();But when I try to list the files, I get a SecurityException.
Can anyone help me out?
Peace!
LoCalhttp://search.java.sun.com/search/java/index.jsp?col=javaforums&qp=&qt=%2Blist+%2Bfile+%2Bserver
-
How to duplicate a file in a directory to another directory?
I am a student just has just learn some basic Java programming...May i know how to duplicate a file in a directory to another directory?
How to start in doing this?
Thank YouI was suggesting to use java to send commands to the system shell so to speak....
I don't know of a way to do this... under the File class you can delete files, but there is no provision to copy Files so to speak....
one way would to be to open the file you want to copy with a file reader, and then write it all out to your new file.
see http://java.sun.com/j2se/1.3/docs/api/java/io/FileReader.html for information of FileReaders -
Bridge CC: how to show hidden files?
My search returned hidden files.
Could you please show me how to reveal hidden files.
View | Show Hidden files IS checked.
Thanks.Open the Script Editor or AppleScript Editor in one of the subfolders of Applications and run the following:
tell application "Finder" to quit
if (do shell script "defaults read com.apple.finder AppleShowAllFiles") is "1" then
do shell script "defaults write com.apple.finder AppleShowAllFiles 0"
else
do shell script "defaults write com.apple.finder AppleShowAllFiles 1"
end if
delay 2
tell application "Finder" to run
If you change your mind later, run the script again.
(65149) -
Getting the list of files in a directory by their last modified date
Dear friends,
I want to get the list of files in a directory sorted by their last modified date.
By default the file.list() or listFiles() return files sorted by their name in ascending order.
Please give me your suggestions.
Thanks in advance,
James.Thanks friend,
I myself got the answer
here is my code:
public File[] getSortedFileList(File dir){
File[] originalList = dir.listFiles();
int numberOfFiles = originalList.length;
File[] sortedList = new File[numberOfFiles];
long[] lastModified = new long[numberOfFiles];
for(int i = 0; i < numberOfFiles; i++){
lastModified[i] = originalList.lastModified();
Arrays.sort(lastModified);
for(int i = 0; i < numberOfFiles; i++){
for(int k = 0; k < numberOfFiles; k++){
if(originalList[k].lastModified() == lastModified[i])
sortedList[i] = originalList[k];
System.out.println("The sorted file list is:" + sortedList[i]);
return sortedList;
Maybe you are looking for
-
Problem with subscript and superscript in tables when exporting in .pdf
When I put some words in superscript (or subscript) in a table, a bug occurs when exporting in pdf (whit export or print either). All the words in the cell after the subscript part disappear in the pdf version. The rest of the table or the document i
-
Safari won't open after OS 10.4 software update combo update
I am working on a computer iMac g5 1.8ghz, 600 mhz Bus, 512mb Ram was 10.3.9 but Safari was not working because Safari 3.1.1 was installed. I tried removing all safari, cache, plist to no avail, Firefox worked after reinstall. I remove safari and upg
-
How control buttons in JSP?
Hi there, I'm currently working with some educational content I found here: http://otn.oracle.com/obe/obe9051jdev/ADFtoJSP/defaultendtoend.htm I followed these steps: -Create new app workspace -Use the default web application template -right click th
-
Join multiple tables across separate databases
I needed to perform a join on multiple tables in two separate databases. I am using Sybase ASE 12.5 and jConnect 5.5 JDBC driver. Table A is in DB1 and Table B is in DB2. Both DB1 and DB2 reside on the same database server. I have set up JNDI bound d
-
Catching Incoming Payments As They Occur
I have an issue to collect data on incoming payments as they occur. In other words, as a payments is entered on an AR Invoice, I need to update some sales history data in a user table using the SDK. This does not seem to present a problem except fo