Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
Code:
1. The problem statement, all variables and given/known data:
You should also know how to find files based on their characteristics.
Use stat to list the meta data for the file with inode number 2793324. Your command should suppress error messages. Hint: command substitution will make this easier!
How many bytes would be in this file if all the alphas (a-z and A-Z) and all the numerics (0-9) where removed from it?
2. Relevant commands, code, scripts, algorithms:
See 1 & 2
3. The attempts at a solution (include all code and scripts):
So i am trying to remove the Alpha and Numeric characters, so i am using tr to do this, but it keep dumping characters on my screen? when i try to do this. Is this because when i less it it tells me its a binary file?
tr -d "[:alnum:]" < LC_NAME4
Also wasnt sure if it was an issue with permissions as well so i made copies of the file to work on and changed permissions (chmod 7777 LC_NAME4)
less LC_NAME4
^]^Q^C ^G^@^@^@$^@^@^@/^@^@^@0^@^@^@=^@^@^@S^@^@^@f^@^@^@|^@^@^@%p%t%f%t%g^@^@শ�<8D>র�<80>^@শ�<8D>র�<80>মত�<80>^@�<95>�<81>মার�<80>^@শ�<8D>র�<80>মত�<80>^@UTF-8^@
LC_NAME4 lines 1-1/1 (END)
Is there something im doing worn with tr?
4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
KeeneState, KSC, Keene, NH, USA, Charlie W., CS215-01
Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).
---------- Post updated at 10:44 PM ---------- Previous update was at 09:04 PM ----------
Looking tr it looks more like it for replacing? So would i be able use sed with the d option?
I have AIX 5.1
I was wondering how to remove a file name with a space in it Say {tb lsv.csv} ? When I use the {rm} command if you have a space it thinks it is a new file. So it looks for {tb} and {lsv.csv} instead of the name as a whole.
Thanks in advance
Dave
By the way guys and gals the... (5 Replies)
Hi,
I have a shell scripting. This will take 7 digit number in each line and add 7 digit number with next subsequent lines ( normal addition ).
Eg:
0000001
0000220
0001235
0000022
0000023
...........
.........
........
Like this i am having around 1500000 records. After adding... (23 Replies)
Hi - I tried to remove ^M in a delimited file using "tr -d "\r" and "sed 's/^M//g'", but it does not work quite well. While the ^M is removed, the format of the record is still cut in half, like
a,b, c
c,d,e
The delimited file is generated using sh script by outputing a SQL query result to... (7 Replies)
Hi All,
I want to remove last word from a line using Vi.
Do we have any vi command for that.
line : ss dd ff gg
i have to run some vi command which can delete gg from the line
Thanks,
Ravi Sadani (4 Replies)
In LINUX(CentOS, RedHat) is there a way to have the banner statement appear before the logon instead of after the logon? In UNIX and Windows the banner appears before a person actually logs on, what I'm seeing in LINUX is that it appears after the login(ftp, telnet, SSH).
Thanks (0 Replies)
Hi,
I have a file with rows like below delimited with pipe (|)
I want to remove all the leading and trailing white space from each and every fields keeping the delimiter intact.
I have tired this
sed 's/*//g;s/*$//g'
but the result is incorrect
it is removing a whitespace from... (6 Replies)
Hello everyone, I'm in need of some assistance. I'm currently enrolled in an introductory UNIX shell programming course and, well halfway through the semester, we are receiving our first actual assignment. I've somewhat realized now that I've fallen behind, and I'm working to get caught up, but for... (1 Reply)
Hi,
Below is a scattered representation of numbers .
1 2
11 22
11 22
1 2
1 2
11 22
1 2
11 22
I need to display only the following sequence "" and delete of the remainder from the output. The output should look like (2 Replies)
Hi All,
I am using the below script which has awk command, but it is not returing the expected result. can some pls help me to correct the command.
The below script sample.ksh should give the result if the value of last 4 digits in the variable NM matches with the variable value DAT. The... (7 Replies)
Hi Everybody! First post! Totally noobie.
I'm using the terminal to read a poorly formatted book.
The text file contains, in the middle of paragraphs, hyphenation to split words that are supposed to be on multiple pages. It looks ve -- ry much like this.
I was hoping to use grep -v " -- "... (5 Replies)
Discussion started by: AxeHandle
5 Replies
LEARN ABOUT PLAN9
truncate
TRUNCATE(1) User Commands TRUNCATE(1)NAME
truncate - shrink or extend the size of a file to the specified size
SYNOPSIS
truncate OPTION... FILE...
DESCRIPTION
Shrink or extend the size of each FILE to the specified size
A FILE argument that does not exist is created.
If a FILE is larger than the specified size, the extra data is lost. If a FILE is shorter, it is extended and the extended part (hole)
reads as zero bytes.
Mandatory arguments to long options are mandatory for short options too.
-c, --no-create
do not create any files
-o, --io-blocks
treat SIZE as number of IO blocks instead of bytes
-r, --reference=RFILE
base size on RFILE
-s, --size=SIZE
set or adjust the file size by SIZE bytes
--help display this help and exit
--version
output version information and exit
The SIZE argument is an integer and optional unit (example: 10K is 10*1024). Units are K,M,G,T,P,E,Z,Y (powers of 1024) or KB,MB,... (pow-
ers of 1000).
SIZE may also be prefixed by one of the following modifying characters: '+' extend by, '-' reduce by, '<' at most, '>' at least, '/' round
down to multiple of, '%' round up to multiple of.
AUTHOR
Written by Padraig Brady.
REPORTING BUGS
GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
Report truncate translation bugs to <http://translationproject.org/team/>
COPYRIGHT
Copyright (C) 2017 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
SEE ALSO dd(1), truncate(2), ftruncate(2)
Full documentation at: <http://www.gnu.org/software/coreutils/truncate>
or available locally via: info '(coreutils) truncate invocation'
GNU coreutils 8.28 January 2018 TRUNCATE(1)