Sponsored Content
Full Discussion: File with a weird name 'q'
Top Forums UNIX for Dummies Questions & Answers File with a weird name 'q' Post 302221805 by methyl on Tuesday 5th of August 2008 08:43:40 AM
Old 08-05-2008
To show the funny characters:
ls -lab *q

In this case because there are no other filenames ending in "q", all you need to know is how many funny characters.

Then rename the file:
e.g. If there is just one character:

mv ?q junk
rm -i junk
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Weird File

$ls -lrt -rw-r--r-- 1 rathodr users 1757 Jan 6 13:36 cleanup.archive.files.pl -rwxr-xr-x 1 rathodr users 20503 Jan 6 13:52 alarm.control.pl -rw-r--r-- 1 rathodr users 20503 Jan 9 04:52q The last file seems to be a weird file. I am not sure how was it created. Maybe... (5 Replies)
Discussion started by: rahulrathod
5 Replies

2. UNIX for Dummies Questions & Answers

How to delete a weird file name

Hi, How do I delete a file name that starts with a hypen? e.g. -unix_file_2006_10_3 I always get an erroe when I use rm command. I am using Solaris. Thanks, Hi, One of the Unix books I read to remove this weird file suggest to use: "rm ./-unix_file_2006_10_3" which I did today and file... (3 Replies)
Discussion started by: XZOR
3 Replies

3. Shell Programming and Scripting

Weird Ascii characters in file names

Hi. I have files in my OS that has weird file names with not-conventional ascii characters. I would like to run them but I can't refer them. I know the ascii # of the problematic characters. I can't change their name since it belongs to a 3rd party program... but I want to run it. is there... (2 Replies)
Discussion started by: yamsin789
2 Replies

4. AIX

weird file list problem

When I do a file list in my spooler directory, I get the following information #ls -l |pg -rw-rw-rw- 1 user1 ugroups 831690 Apr 03 12:52 K6A80403125051.prn :res 2330479869879093344 ext 2330477052380546512 align -rw-rw-rw- 1 user1 ugroups 5900 Apr 03 14:19 K6A80403141858.idx :res... (8 Replies)
Discussion started by: jmmora
8 Replies

5. UNIX for Advanced & Expert Users

Weird working of File Watcher job

I have JIL script like the one below insert_job:F_SAMPLE job_type:f machine:PC001 owner:asla@PC001 watch_file:/home/shah/one/sample.trg watch_interval:90 alarm_if_fail:1Here my question is, there is a directory one under that file needs to be watched sample.trg..! but directory one owned... (0 Replies)
Discussion started by: shahnazurs
0 Replies

6. Shell Programming and Scripting

Find files older than X with a weird file format

I have an issue with a korn shell script that I am writing. The script parses through a configuration file which lists a heap of path/directories for some files which need to be FTP'd. Now the script needs to check whether there are any files which have not been processed and are X minutes old. ... (2 Replies)
Discussion started by: MickAAA
2 Replies

7. Shell Programming and Scripting

share a shell script which can replace weird characters in directory or file name

I just finish the shell script . This shell can replace weird characters (such as #$%^@!'"...) in file or directory name by "_" I spent long time on replacing apostrophe in file/directory name added: 2012-03-14 the 124th line (/usr/bin/perl -i -e "s#\'#\\'#g" /tmp/rpdir_level$i.tmp) is... (5 Replies)
Discussion started by: begonia
5 Replies

8. UNIX for Dummies Questions & Answers

Weird Error moving a file

Hi, We are running into very weird error on AIX. Target directory exists on NFS. We have one script runs every 5 mins on our system. This script is running for 5 years for now without any issuess. Followig is the snapshot of the script : stmt_cnt=$(ls -1 ${1}/${2}|wc -l) if ;... (7 Replies)
Discussion started by: himihir2000
7 Replies

9. Shell Programming and Scripting

Weird ? symbol coming through-sending text file

Hi All, When I am trying to send a text file through Unix,I get a weird symbol in the .txt file. The symbol is ? in a box (square)....which is making the file unloadable. Please help me with the solution. Thanks in advance Gopi (1 Reply)
Discussion started by: gopi.palleti
1 Replies

10. Shell Programming and Scripting

Weird Error (: No such file or directory)

Hi Everyone, I am trying to make this script to use, to find out the DAHDI channel status. Every thing works fine, I even get proper results, however I have this weird error that comes along. Can someone please help me. Thanks a lot. #!/bin/bash # Color to set the test to when a channel is... (3 Replies)
Discussion started by: jeetz
3 Replies
FORTUNE(6)						       UNIX Reference Manual							FORTUNE(6)

NAME
fortune - print a random, hopefully interesting, adage SYNOPSIS
fortune [-acefilosuw] [-n length] [ -m pattern] [[n%] file/dir/all] DESCRIPTION
When fortune is run with no arguments it prints out a random epigram. Epigrams are divided into several categories, where each category is sub-divided into those which are potentially offensive and those which are not. Options The options are as follows: -a Choose from all lists of maxims, both offensive and not. (See the -o option for more information on offensive fortunes.) -c Show the cookie file from which the fortune came. -e Consider all fortune files to be of equal size (see discussion below on multiple files). -f Print out the list of files which would be searched, but don't print a fortune. -l Long dictums only. See -n on how ``long'' is defined in this sense. -m pattern Print out all fortunes which match the basic regular expression pattern. The syntax of these expressions depends on how your system defines re_comp(3) or regcomp(3), but it should nevertheless be similar to the syntax used in grep(1). The fortunes are output to standard output, while the names of the file from which each fortune comes are printed to standard error. Either or both can be redirected; if standard output is redirected to a file, the result is a valid fortunes database file. If standard error is also redirected to this file, the result is still valid, but there will be ``bogus'' fortunes, i.e. the filenames themselves, in parentheses. This can be useful if you wish to remove the gathered matches from their original files, since each filename-record will precede the records from the file it names. -n length Set the longest fortune length (in characters) considered to be ``short'' (the default is 160). All fortunes longer than this are considered ``long''. Be careful! If you set the length too short and ask for short fortunes, or too long and ask for long ones, fortune goes into a never-ending thrash loop. -o Choose only from potentially offensive aphorisms. The -o option is ignored if a fortune directory is specified. Please, please, please request a potentially offensive fortune if and only if you believe, deep in your heart, that you are willing to be offended. (And that you'll just quit using -o rather than give us grief about it, okay?) ... let us keep in mind the basic governing philosophy of The Brotherhood, as handsomely summarized in these words: we believe in healthy, hearty laughter -- at the expense of the whole human race, if needs be. Needs be. --H. Allen Smith, "Rude Jokes" -s Short apothegms only. See -n on which fortunes are considered ``short''. -i Ignore case for -m patterns. -w Wait before termination for an amount of time calculated from the number of characters in the message. This is useful if it is exe- cuted as part of the logout procedure to guarantee that the message can be read before the screen is cleared. -u Don't translate UTF-8 fortunes to the locale when searching or translating. The user may specify alternate sayings. You can specify a specific file, a directory which contains one or more files, or the special word all which says to use all the standard databases. Any of these may be preceded by a percentage, which is a number n between 0 and 100 inclusive, followed by a %. If it is, there will be a n percent probability that an adage will be picked from that file or directory. If the percentages do not sum to 100, and there are specifications without percentages, the remaining percent will apply to those files and/or directories, in which case the probability of selecting from one of them will be based on their relative sizes. As an example, given two databases funny and not-funny, with funny twice as big (in number of fortunes, not raw file size), saying fortune funny not-funny will get you fortunes out of funny two-thirds of the time. The command fortune 90% funny 10% not-funny will pick out 90% of its fortunes from funny (the ``10% not-funny'' is unnecessary, since 10% is all that's left). The -e option says to consider all files equal; thus fortune -e funny not-funny is equivalent to fortune 50% funny 50% not-funny This fortune also supports the BSD method of appending ``-o'' to database names to specify offensive fortunes. However this is not how fortune stores them: offensive fortunes are stored in a seperate directory without the ``-o'' infix. A plain name (i.e., not a path to a file or directory) that ends in ``-o'' will be assumed to be an offensive database, and will have its suffix stripped off and be searched in the offensive directory (even if the neither of the -a or -o options were specified). This feature is not only for backwards-compati- bility, but also to allow users to distinguish between inoffensive and offensive databases of the same name. For example, assuming there is a database named definitions in both the inoffensive and potentially offensive collections, then the follow- ing command will select an inoffensive definition 90% of the time, and a potentially offensive definition for the remaining 10%: fortune 90% definitions definitions-o FILES
Note: these are the defaults as defined at compile time. /usr/share/games/fortunes Directory for innoffensive fortunes. /usr/share/games/fortunes/off Directory for offensive fortunes. If a particular set of fortunes is particularly unwanted, there is an easy solution: delete the associated .dat file. This leaves the data intact, should the file later be wanted, but since fortune no longer finds the pointers file, it ignores the text file. BUGS
The division of fortunes into offensive and non-offensive by directory, rather than via the `-o' file infix, is not 100% compatible with original BSD fortune. Although the `-o' infix is recognised as referring to an offensive database, the offensive database files still need to be in a separate directory. The workaround, of course, is to move the `-o' files into the offensive directory (with or without renam- ing), and to use the -a option. The supplied fortune databases have been attacked, in order to correct orthographical and grammatical errors, and particularly to reduce redundancy and repetition and redundancy. But especially to avoid repetitiousness. This has not been a complete success. In the process, some fortunes may also have been lost. The fortune databases are now divided into a larger number of smaller files, some organized by format (poetry, definitions), and some by content (religion, politics). There are parallel files in the main directory and in the offensive files directory (e.g., fortunes/defini- tions and fortunes/off/definitions). Not all the potentially offensive fortunes are in the offensive fortunes files, nor are all the for- tunes in the offensive files potentially offensive, probably, though a strong attempt has been made to achieve greater consistency. Also, a better division might be made. HISTORY
This version of fortune is based on the NetBSD fortune 1.4, but with a number of bug fixes and enhancements. The original fortune/strfile format used a single file; strfile read the text file and converted it to null-delimited strings, which were stored after the table of pointers in the .dat file. By NetBSD fortune 1.4, this had changed to two separate files: the .dat file was only the header (the table of pointers, plus flags; see strfile.h), and the text strings were left in their own file. The potential problem with this is that text file and header file may get out of synch, but the advantage is that the text files can be easily edited without resorting to unstr, and there is a potential savings in disk space (on the assumption that the sysadmin kept both .dat file with strings and the text file). Many of the enhancements made over the NetBSD version assumed a Linux system, and thus caused it to fail under other platforms, including BSD. The source code has since been made more generic, and currently works on SunOS 4.x as well as Linux, with support for more platforms expected in the future. Note that some bugs were inadvertently discovered and fixed during this process. At a guess, a great many people have worked on this program, many without leaving attributions. SEE ALSO
re_comp(3), regcomp(3), strfile(1), unstr(1) BSD Experimental 19 April 94 [May. 97] FORTUNE(6)
All times are GMT -4. The time now is 10:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy